---
title: "Discussion on \"Let the Compiler Review Your UI: Choosing Between Enums, Sealed Classes, and Sealed Interfaces\" | Hashnode"
description: "Discussion on \"Let the Compiler Review Your UI: Choosing Between Enums, Sealed Classes, and Sealed Interfaces\". Learn when to use Kotlin enums, sealed classes, or sealed interfaces for Android UI state, and how exhaustive when catches missed cases early."
url: "https://hashnode.com/posts/let-the-compiler-review-your-ui-choosing-between-enums-sealed-classes-and-sealed-interfaces/6af4a26e6c48498f5e1cef18"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Let the Compiler Review Your UI: Choosing Between Enums, Sealed Classes, and Sealed Interfaces](https://android-expert.hashnode.dev/let-the-compiler-review-your-ui-choosing-between-enums-sealed-classes-and-sealed-interfaces?utm_source=hashnode&utm_medium=feed)

Learn when to use Kotlin enums, sealed classes, or sealed interfaces for Android UI state, and how exhaustive when catches missed cases early.

10h ago · 23 min read · android-expert.hashnode.dev  
Read the article

-   [#sealed-classes](https://hashnode.com/tag/sealed-classes)
-   [#sealed-interfaces](https://hashnode.com/tag/sealed-interfaces)
-   [#jetpack-compose](https://hashnode.com/tag/jetpack-compose)
-   [#kotlin-enums](https://hashnode.com/tag/kotlin-enums)
-   [#exhaustive-when](https://hashnode.com/tag/exhaustive-when)

## Written by

[Android Expert](https://hashnode.com/@android-expert)

@android-expert · Chennai, India

  
[View profile](https://hashnode.com/@android-expert)

Android Expert· Kotlin, Jetpack Compose & production pitfalls

Android Engineer &amp; Kotlin Advocate. 🚀 Deep dives into Jetpack Compose, Coroutines, and Clean Architecture. Turning complex code into scalable solutions. 🛠️✨

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
