package singleton;
public class Singleton {
private static Singleton instance;
private String name;
public static boolean flag = true;
public Singleton() {
}
private Singleton(String name){
this.name = name;
}
public String getName(){
return name;
}
public static Singleton getInstance(String name){
if(instance==null)
instance = new Singleton(name);
else flag = false;
return instance;
}
}