How can I create static method for enum in Kotiln? Technology Community › Category: Kotlin › How can I create static method for enum in Kotiln? 0 Vote Up Vote Down VietMX Staff asked 4 years ago Just like with any other class, you can define a class object in an enum class: enum class CircleType { FIRST, SECOND, THIRD; companion object { fun random(): CircleType = FIRST } } Then you’ll be able to call this function asĀ CircleType.random().