Kotlin singleton
snippet in kotlin

Kotlin singleton

user8071

object MySingleton {
    fun myMethod(): Int {
        return 5
    }
}

MySingleton.myMethod() // 5