A Global Singleton is a class of which only one instance exists within a program.

Any attempt to use non-static members of the class involves performing operations on this one instance.




// version 1.1.2
 
object Singleton {
    fun speak() = println("I am a singleton")
}
 
fun main(args: Array<String>) {
    Singleton.speak()
}