Kotlin Singleton objects Use as repalcement of static methods/fields of java


Example

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")