Bird
Raised Fist0

What does the Add method do in a List<T> in C#?

easy🧠 Conceptual Q1 of Q15
C Sharp (C#) - Collections
What does the Add method do in a List<T> in C#?
AAdds an item to the end of the list
BRemoves the first item from the list
CClears all items from the list
DSorts the list items
Step-by-Step Solution
Solution:
  1. Step 1: Understand the Add method purpose

    The Add method is designed to insert a new element at the end of the list.
  2. Step 2: Compare with other methods

    Remove removes items, Clear empties the list, Sort orders items. Add only adds.
  3. Final Answer:

    Adds an item to the end of the list -> Option A
  4. Quick Check:

    Add method = Adds item [OK]
Quick Trick: Add always appends item at list's end [OK]
Common Mistakes:
MISTAKES
  • Confusing Add with Remove
  • Thinking Add sorts the list
  • Assuming Add clears the list

Want More Practice?

15+ quiz questions · All difficulty levels · Free

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