what is the purpose of `object` ? isn't it basical...
# announcements
l
what is the purpose of
object
? isn't it basically same as top level members in a separate package?
j
object Elvis
defines a singleton (there is only one Elvis) Not the same because after imports they will look like
Elvis.GREATEST_HITS
and
GREATEST_HITS
. The former is better IMHO
l
so basically the purpose is just structure (where to find a function) and accessibility (public/private/ect) right?
k
And they can implement interfaces, I also use them for "do nothing" interface implementations.
For example the stdlib has the empty list, set and iterator as objects I think.