Use as a replacement for Java static methods and fields

suggest change
object CommonUtils {

    var anyName: String = "Hello"

    fun dispMsg(message: String) {
        println(message)
    }
}

From any other class, just invoke the variable and functions in this way:

CommonUtils.anyName
CommonUtils.dispMsg("like static call")

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents