- 명령 팔레트: cmd+shift+p / ctrl+shift+p
- 현재 파일을 새 창으로 띄우기: cmd + k 후 손가락 떼고 o
- 자동 라인브레이크 토글: option + z
This file contains hidden or 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
| class Singleton private constructor() { | |
| companion object { | |
| // Volatile: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-volatile/index.html | |
| @Volatile private var instance: Singleton? = null | |
| // JvmStatic: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-static/index.html | |
| @JvmStatic fun getInstance(): Singleton = | |
| instance ?: synchronized(this) { | |
| instance ?: Singleton().also { | |
| instance = it |
NewerOlder