티스토리 뷰

App/Android Native

KOTLIN BASIC V

Agrafenaaa 2021. 10. 8. 16:00

Ref: https://www.youtube.com/channel/UCutO2H_AVmWHbzvE92rpxjA (개발하는 정대리님)

 

  • Singleton

- a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.

- kotlin에서는 한 메모리를 사용하는 것으로 이해 + class가 아닌 object로 선언

@Volatile : marks the JVM backing field of the annotated property as volatile, meaning that writes to this field are immediately made visible to other threads.