Add custom value to enum class

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")
}
1 Like