• Java singleton pattern

    D00msDay        
    0 Likes0 Commentsjava

    class Singleton {
      private static instance;
      
      private Singleton() {
      }
      
      public static Singleton getInstance {
        if (instance == null) {
          instance = new Singleton();
        }
        return instance;
      }
      
    }

Comments (0)