Enums are a great way to enforce type and value safety. Just like in Java, Kotlin also has enums and the following way in which an enum can be defined:
enum class Transaction(var code : Char) {
DEPOSIT('d'),
WITHDRAW('w')
}
Enums are a great way to enforce type and value safety. Just like in Java, Kotlin also has enums and the following way in which an enum can be defined:
enum class Transaction(var code : Char) {
DEPOSIT('d'),
WITHDRAW('w')
}
3.141.3.175