Hi, can enum in kotlin have custom val? Like,
enum class Something{
HELLO{
val desc = "Hello World"
}
}
and retrieve it something like
Something.HELLO.desc
Thanks.
Hi, can enum in kotlin have custom val? Like,
enum class Something{
HELLO{
val desc = "Hello World"
}
}
and retrieve it something like
Something.HELLO.desc
Thanks.
enum class Something(val desc: String) {
HELLO("Hello World")
}