Bird
0
0

Which Kotlin interface allows you to add or remove elements from a collection?

easy📝 Conceptual Q2 of 15
Kotlin - Collections Fundamentals
Which Kotlin interface allows you to add or remove elements from a collection?
AList
BSet
CMutableList
DCollection
Step-by-Step Solution
Solution:
  1. Step 1: Recall mutable interfaces in Kotlin

    MutableList interface supports modification methods like add and remove.
  2. Step 2: Confirm mutability

    List and Collection interfaces are read-only; Set is also immutable by default.
  3. Final Answer:

    MutableList -> Option C
  4. Quick Check:

    Mutable interface = MutableList [OK]
Quick Trick: Mutable interfaces have methods like add() and remove() [OK]
Common Mistakes:
MISTAKES
  • Choosing List instead of MutableList
  • Confusing Set with MutableList
  • Assuming Collection is mutable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes