Check out example codes for "java singleton implementation". It will help you in understanding the concepts better.

Code Example 1

public class SingletonClass {
    private static final SingletonClass SINGLE_INSTANCE = new SingletonClass();
    private SingletonClass() {}
  public static SingletonClass getInstance() {
      return SINGLE_INSTANCE;
    }
}

Learn ReactJs, React Native from akashmittal.com