Here my code:
private static JavaClass INSTANCE = null;
public static JavaClass getInstance()
{
if ( INSTANCE == null )
{
INSTANCE = new JavaClass();
}
return INSTANCE;
}
private JavaClass() {
}
What is the use of this pattern and how does it work?
Aucun commentaire:
Enregistrer un commentaire