Frage im Vorstellungsgespräch bei BlackBerry

Private constructor

Antwort im Vorstellungsgespräch

Anonym

9. Juni 2011

Singleton design pattern. You declare a method, getInstance(), which enforces a rule that the class in question can be instantiated ONLY once. If it has not been instantiated, the public getInstance() will then invoke the private constructor which it has access to