Skip to content

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.

More on Kotlin language

Flashcards for this topic