Koltin, Sealed Classes In Kotlin, Android.
UIEvent() data class RegistrationSubmitted(val username: String, val password: String) : UIEvent() } fun handleUIEvent(event: UIEvent) { when (event) { UIEvent.LoginClicked -> // Login handling is RegistrationSubmitted -> // Registration handling with type safety for username and password } } 10.