Can I always use Kotlin's Object instead of usual...
# getting-started
o
Can I always use Kotlin's Object instead of usual structure of getting Singleton in Java? http://prntscr.com/nfb8xr Or it can bring some problem? for example in time working in different threads.
d
Yes you can always use Kotlin's Object. It is thread safe.
n
… safe if it is immutable.
d
Acquiring the
object
instance is thread safe.
d
unless you want to instantiate it lazely
o
ok, thanks!)