Intermediate
Kotlin
Q46 / 100
What is the purpose of reified type parameters?
Correct! Well done.
Incorrect.
The correct answer is B) To retain the generic type at runtime inside inline functions, enabling is and as checks on type parameters
B
Correct Answer
To retain the generic type at runtime inside inline functions, enabling is and as checks on type parameters
Explanation
Normally, generics are erased at runtime. reified (only in inline functions) preserves the type, allowing inline fun <reified T> isOf(value: Any) = value is T.
Progress
46/100