KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am reading Programming in Scala, and I don't understand the following sentence (pdf p.112): Each singleton object is implemented as an instance of a synthetic class referenced from a static variable, so they have the same initialization semantics as Java statics. Does this mean the if I have a singleton FooBar in scala, the compiler will create a class named FooBar$ ? Also what does the author mean by "referenced from a static variable"? Is there a hidden static variable somewhere holding a reference to some FooBar$ class? I appreciate any help here.
Tags (comma-separated)
Save Edits
Cancel