In short: use an enum class when a value must be one of a small, fixed set that you know at compile time, and every option has the same shape. Each constant is a single object. It can carry values and its own behavior. When the options need different data, use a sealed class instead.
Adding a constant to an enum takes one line. Adding it in the wrong place can break data you saved last year.
Have you ever saved an enum to SharedPreferences, shipped the app, and later added a constant in the middle of the list? The code still compiles. But every user who saved the old value now reads a different status, and nothing crashes to tell you.
This post covers what an enum class is, how to add values and behavior to it, why entries replaced values() , and how to save an enum so it survives changes.
What is an enum class in Kotlin?
An enum class is a class with a fixed list of instances.…