Question d’entretien chez BlackBerry

Private constructor

Réponse à la question d'entretien

Utilisateur anonyme

9 juin 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