Singleton: Difference between revisions

No change in size ,  7 years ago
→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
m (→‎{{header|Kotlin}}: Adjusted line spacing)
(→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details)
Line 1,149:
=={{header|Kotlin}}==
Kotlin has built-in support for singletons via object declarations. To refer to the singleton, we simply use its name which can be any valid identifier other than a keyword:
<lang scala>// version 1.1.12
 
object Singleton {