hi everyone, what is difference between companion ...
# getting-started
e
hi everyone, what is difference between companion object and object keyword? tks so much 18 replies Companion object is an object that shares namespace with its containing class. You can refer to the members of companion object using the scope of the containing class both outside and inside of the class. In particular, it means, that inside the class you can refer to the
member
of companion object directly, without writing
Companion.member
and outside of the class you can write
Class.member
instead of
Class.Companion.member
.