public class Shayanlinux {
private static class ShayanlinuxSingletonHolder{
private static final Shayanlinux INSTANCE = new Shayanlinux();
}
private String about;
// Because Shayanlinux is singleton the constructor is private
private Shayanlinux() {
about = "An Explorer!";
}
public static Shayanlinux getInstance(){
return ShayanlinuxSingletonHolder.INSTANCE;
}
public String getAbout() {
return this.about;
}
}
public class Stackoverflow {
public static void main(String args[])
{
System.out.println(Shayanlinux.getInstance().getAbout());
}
}