Kotlin & Coroutines (50 Qs)•Part 1: Core Language, Type System & Syntax (1 - 10)
What are Sealed Classes and Sealed Interfaces and how do they enable exhaustive when checks?
junior LevelTypeScript
In Simple Words:
Sealed hierarchies restrict subclassing to the same package and compilation module. The compiler guarantees that all possible subclasses are known, allowing when expressions to be exhaustive without an else branch.