Created
April 17, 2020 19:30
-
-
Save yenerm/1f8ea978c1b2b48a898df26d303f8bab to your computer and use it in GitHub Desktop.
Singleton via object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
object Singleton { | |
private var count: Int = 0 | |
fun count() { | |
count++ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment