| Start |
|---|
| Initialization Enum classes as any other classes can have a constructor and be initialized |
| Functions and Properties in enums Enum classes can also declare members (i.e. properties and functions). A semicolon ( If a member is |
Simple enum Each enum constant is an object. Enum constants are separated with commas. |
| Mutability Enums can be mutable, this is another way to obtain a singleton behavior: RemarksJust like in Java, enum classes in Kotlin have synthetic methods allowing to list the defined enum constants and to get an enum constant by its name. The signatures of these methods are as follows (assuming the name of the enum class is The Every enum constant has properties to obtain its name and position in the enum class declaration: The enum constants also implement the Comparable interface, with the natural order being the order in which they are defined in the enum class. |
Read Article
https://develop.horje.com/learn/1434/reference