Kotlin - Collections FundamentalsWhat is the default value of elements in an IntArray created with size 4 in Kotlin?AnullB0C-1DundefinedCheck Answer
Step-by-Step SolutionSolution:Step 1: Recall default initialization of IntArrayIn Kotlin, IntArray elements are initialized to 0 by default.Step 2: Match default value with optionsOnly 0 correctly states 0 as the default value.Final Answer:0 -> Option BQuick Check:IntArray default value = 0 [OK]Quick Trick: IntArray elements default to zero [OK]Common Mistakes:MISTAKESAssuming null as defaultThinking default is -1Believing elements are uninitialized
Master "Collections Fundamentals" in Kotlin9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kotlin Quizzes Collections Fundamentals - Map creation (mapOf, mutableMapOf) - Quiz 1easy Collections Fundamentals - Iterating collections with forEach - Quiz 4medium Functions - Why functions are first-class in Kotlin - Quiz 13medium Functions - Infix functions for readable calls - Quiz 3easy Kotlin Basics and JVM Runtime - What is Kotlin - Quiz 4medium Kotlin Basics and JVM Runtime - Print and println output - Quiz 5medium Null Safety - Non-nullable types by default - Quiz 1easy Null Safety - Nullable types with ? suffix - Quiz 11easy Operators and Expressions - Operator overloading concept - Quiz 5medium Operators and Expressions - Logical operators (&&, ||, !) - Quiz 3easy