https://kotlinlang.org logo
Title
u

user

06/28/2022, 3:31 AM
How to declare Singleton instance in Kotlin , is it similar to how we declare Singleton class? In an interview I was told to write a Singleton class so I wrote the following code object Ant{ } but later he asked me to write Singleton instance which confused me and I ended up writing like this object what{ } now, I know I am wrong but I am really curious how to write down Singleton Instance.