Answers for "kotlin declare a singleton"

0

Kotlin singleton

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

MySingleton.myMethod() // 5
Posted by: Guest on May-17-2020

Browse Popular Code Answers by Language