Guys which one is better for creating a singleton ...
# announcements
s
Guys which one is better for creating a singleton class in kotlin? Just like in plain old java using
abstract
class or
object
?
d
object
is specifically designed to make writing singletons easy. So use
object
.
u
Do you use abstract class to create singletons in java?
d
I certainly wouldn't.
u
That's my thought
s
Oh im sorry. what i actually meant was creating some static function and returning the instances. My bad 😅