MediumConceptKotlin language
What are sealed classes and why are they useful for state?
What a good answer covers
A sealed class restricts its subclasses to a known set, so when expressions over it can be exhaustive, which models UI states such as Loading, Success and Error safely.
PreviousWhat is the difference between lateinit and lazy in Kotlin?Next What is the difference between a companion object and an object declaration?