Kotlin theorytheory 0/50 · 0%
OOP · medium

32. Object Declarations (Singletons)

Singleton pattern in Kotlin.

Using 'object' instead of 'class' creates a thread-safe singleton instance.

Check your understanding

  1. 1. Keyword for singleton?

  2. 2. When is the object initialized?