Bird
0
0

Why might you choose a collection like List<T> over an array in C#?

easy🧠 Conceptual Q11 of 15
C Sharp (C#) - Collections
Why might you choose a collection like List<T> over an array in C#?
ABecause collections can change size dynamically while arrays have fixed size.
BBecause arrays have more built-in methods than collections.
CBecause collections use less memory than arrays.
DBecause arrays can store different data types in the same array.
Step-by-Step Solution
Solution:
  1. Step 1: Understand array size behavior

    Arrays in C# have a fixed size once created and cannot grow or shrink.
  2. Step 2: Understand collection size behavior

    Collections like List<T> can dynamically add or remove items, changing their size.
  3. Final Answer:

    Because collections can change size dynamically while arrays have fixed size. -> Option A
  4. Quick Check:

    Collections grow/shrink; arrays fixed size [OK]
Quick Trick: Remember: arrays fixed size, collections flexible size [OK]
Common Mistakes:
MISTAKES
  • Thinking arrays can resize automatically
  • Believing collections use less memory always
  • Confusing data type storage capabilities

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Sharp (C#) Quizzes