Join Slack
Powered by
How do an object inside a class with a companion o...
# announcements
s
sbeve
12/16/2020, 7:55 AM
How do an object inside a class with a companion object keyword and an object inside the same class with just the object keyword differ? Would the one withour "companion" would be created upon every instance of the class?
s
Sinan Gunes
12/16/2020, 8:07 AM
can you give a pseudo code ?
o
Ole K. Øverland (Norway)
12/16/2020, 8:34 AM
https://stackoverflow.com/questions/43814616/kotlin-difference-between-object-and-companion-object-in-a-class
n
nanodeath
12/16/2020, 5:41 PM
if I'm reading your question right, they're all singletons, but they're referenced differently.
2
Views
Open in Slack
Previous
Next