Questions
Kotlin questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Understanding the `out` Keyword in Kotlin Generics
Learn what the `out` keyword means in Kotlin generics, how covariance works, and when to use `out T` with simple examples.
Updating MutableLiveData from Coroutines in Kotlin: setValue vs postValue
Learn why MutableLiveData.setValue fails on background threads in Kotlin coroutines and how to update LiveData safely in Android.
What `suspend` Means in Kotlin Coroutines
Learn what `suspend` means in Kotlin coroutines, which coroutine is suspended, and how suspension differs from blocking threads.
What the Elvis Operator Does in Kotlin
Learn how Kotlin's Elvis operator (?:) works, how it handles null values, and how it compares to an if expression.
What the `by` Keyword Does in Kotlin: Delegated Properties Explained
Learn what the `by` keyword means in Kotlin, especially for delegated properties in Android and Kotlin apps, with examples and common mistakes.
What to Use Instead of Deprecated Handler() in Android Kotlin
Learn why Handler() is deprecated in Android Kotlin and how to replace it with Handler(Looper), coroutines, or view.postDelayed().
When to Use Inline Functions in Kotlin
Learn when to use inline functions in Kotlin, how lambdas are compiled, and why inline can improve higher-order function performance.
When to Use run, let, apply, also, and with in Kotlin
Learn when to use Kotlin scope functions run, let, apply, also, and with with clear examples, comparisons, mistakes, and a mini project.
Why Kotlin Smart Cast Fails on Mutable Properties: var, Null Safety, and Elegant Fixes
Learn why Kotlin smart cast fails on mutable properties and how to fix it safely using local vals, safe calls, and null handling.
fold() vs reduce() in Kotlin: Difference, Examples, and When to Use Each
Learn the difference between fold() and reduce() in Kotlin with simple examples, execution steps, common mistakes, and when to use each.
launch/join vs async/await in Kotlin Coroutines
Learn the difference between launch/join and async/await in Kotlin coroutines, when to use each, and common mistakes beginners make.
var vs val in Kotlin: Mutable and Read-Only References Explained
Learn the difference between var and val in Kotlin, why both exist, and why a val object can still have mutable properties.
Page 6 of 6 - 112 questions