Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
8
reputation
4

Shayanlinux


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());
        }
}
0
answers
1
question
~68
people reached
  • Earth, TX
  • stackoverflow.com/users/449527
  • Member for 7 years, 3 months
  • 4 profile views
  • Last seen Apr 18 '18 at 8:10

Top tags (3)

Score 0
Posts 1
Score 0
Posts 1
Score 0
Posts 1

Top posts (1) All Questions Answers | Votes Newest

Badges (4)

Gold

Silver

Bronze

4

Rarest