Generally, I have seen instance variables in a Singleton class being kept private. But is it possible to keep it non-private? What if we declare an instance like this:-
final static SingletonClass singletonInstance= new SingletonClass();
Will it cause any problem for the class being a valid Singleton class?
Aucun commentaire:
Enregistrer un commentaire