Generics
50 bites tagged Generics — interview questions with model answers, and 60-second explainers.
Android & Kotlin2 min read
Reified Type Parameters: Accessing Generic Types at Runtime
Reified type parameters let you access generic types at runtime, bypassing JVM type erasure. In Kotlin, you use this inside `inline` functions to check types (`obj is T`) or get a class reference. The footgun: `reified` requires `inline` to work.
Android & Kotlin2 min read
Kotlin's `in` and `out`: Declaration-Site Variance
Kotlin's `out` and `in` keywords define a generic class as a producer or consumer at its declaration, avoiding Java's repetitive wildcards. Use `out T` for types only returned (produced) and `in T` for types only consumed.
Get Generics bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.