When I try the example it compiles and runs fine. Are you sure the constructor is private?
Typically, you would have a public method getInstance() in the class with the private constructor to create an instance of that class. This is used in the Singleton Design Pattern
. But that won't be on the exam.
Also, Bert would have you know there's a whole chapter on the Singleton Pattern in the book Head First Design Patterns.
[ April 19, 2006: Message edited by: J Sato ]