Will the following singleton class code cause any problems in multithreading environment?
public class mySingletonClass{
private static mySingletonClass INSTANCE = new mySingletonClass();
private mySingletonClass()
{
super();
}
public static mySingletonClass getInstance()
{
return INSTANCE;
}
}
Aucun commentaire:
Enregistrer un commentaire