Bird
0
0

In Kotlin, which type is the universal base type that can hold any kind of value?

easy📝 Conceptual Q11 of 15
Kotlin - Data Types
In Kotlin, which type is the universal base type that can hold any kind of value?
A<code>Universal</code>
B<code>Object</code>
C<code>Base</code>
D<code>Any</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand Kotlin's type hierarchy

    Kotlin uses Any as the root of its type system, similar to Object in Java.
  2. Step 2: Identify the universal base type

    Any can hold any non-null value, making it the universal base type in Kotlin.
  3. Final Answer:

    Any -> Option D
  4. Quick Check:

    Universal base type = Any [OK]
Quick Trick: Remember: Kotlin's root type is called Any [OK]
Common Mistakes:
MISTAKES
  • Confusing Any with Object (Java's base type)
  • Thinking Base or Universal are Kotlin types
  • Assuming Any can hold null (it cannot)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes