mardi 1 octobre 2019

Why singleton getInstance method has to be public static in Java

I am just curious why a Singleton class getInstance (or whatever you want to call it) needs to be public static. It only needs to be static not public if that singleton should only be used with in the same package or is my assumption is incorrect.

Aucun commentaire:

Enregistrer un commentaire