1 reputation
1
bio website stackoverflow.com/users/449527
location Earth, TX
age 30
visits member for 2 years, 6 months
seen Aug 16 '13 at 15:02

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());
        }
}

This user has not answered any questions
This user has no recent reputation changes
This user has not asked any questions
This user has not participated in any tags

0 Votes Cast

This user has not cast any votes