Singleton: Difference between revisions
Content added Content deleted
m (→{{header|Kotlin}}: Adjusted line spacing) |
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
||
Line 1,149: | Line 1,149: | ||
=={{header|Kotlin}}== |
=={{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: |
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. |
<lang scala>// version 1.1.2 |
||
object Singleton { |
object Singleton { |