Kotlin - Collections FundamentalsWhy does Kotlin require parentheses around variables in destructuring declarations during collection iteration?ATo specify variable types explicitlyBTo clearly group variables as a single destructuring unitCTo indicate variables are mutableDTo separate variables from the collection nameCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand destructuring syntax rulesParentheses group variables so Kotlin knows they belong together as one destructuring pattern.Step 2: Clarify why grouping is neededThis avoids confusion with multiple variables and separates them from the collection being iterated.Final Answer:To clearly group variables as a single destructuring unit -> Option BQuick Check:Parentheses group destructured variables [OK]Quick Trick: Parentheses group variables in destructuring [OK]Common Mistakes:MISTAKESThinking parentheses declare mutabilityAssuming parentheses separate variables from collectionBelieving parentheses specify types
Master "Collections Fundamentals" in Kotlin9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kotlin Quizzes Control Flow as Expressions - Why expressions over statements matters - Quiz 2easy Functions - Why functions are first-class in Kotlin - Quiz 15hard Functions - Infix functions for readable calls - Quiz 7medium Functions - Parameters with default values - Quiz 14medium Kotlin Basics and JVM Runtime - How Kotlin compiles to JVM bytecode - Quiz 5medium Kotlin Basics and JVM Runtime - Main function as entry point - Quiz 1easy Operators and Expressions - Range operator (..) and in operator - Quiz 3easy Operators and Expressions - Operator precedence - Quiz 5medium Variables and Type System - Constant values with const val - Quiz 6medium Variables and Type System - Var for mutable references - Quiz 1easy