https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
b

Brian Donovan

09/15/2021, 5:34 PM
why can’t we add a constructor to a object class{}?
e

edrd

09/15/2021, 5:36 PM
Because
object
means an instance, not a class, so you cannot instantiate it and therefore a constructor doesn't make sense
b

Brian Donovan

09/15/2021, 5:37 PM
thank you
🤘 1
so what is the difference from a object class{} vs a singleton?
e

edrd

09/15/2021, 5:39 PM
no difference, in Kotlin
object
is meant for implementing singletons
btw, #getting-started is more suited for these kinds of questions