mutableListOf() creates a mutable list. val colors = mutableListOf("red", "green", "blue") uses this correctly with string literals.
Step 2: Check other options
val colors = listOf("red", "green", "blue") creates an immutable list. val colors = mutableListOf("red", "green", "blue") is syntactically valid but unnecessary to specify type explicitly here. val colors = arrayListOf("red", "green", "blue") creates an ArrayList, which is mutable but not the asked function.
Final Answer:
val colors = mutableListOf("red", "green", "blue") -> Option D
Quick Check:
mutableListOf() with values creates mutable list [OK]
Quick Trick:Use mutableListOf() to create mutable lists with initial values [OK]
Common Mistakes:
MISTAKES
Using listOf() which creates immutable list
Unnecessarily specifying generic type
Confusing arrayListOf() with mutableListOf()
Master "Collections Fundamentals" in Kotlin
9 interactive learning modes - each teaches the same concept differently