Singleton mode

From , 5 Years ago, written in Java, viewed 99 times.
URL https://pastebin.vip/view/cfbce4c1
  1. public class Singleton {
  2.  
  3.     //Fields
  4.     private static Singleton instance;
  5.     //Standard default Constructor
  6.     protected Singleton(){};
  7.     //Static method for creating the single instance of the Constructor
  8.     public static Singleton Instance(){
  9.         //initialize if not already done
  10.         if(instance == null)
  11.         instance = new Singleton();
  12.         //return the initialized instance of the Singleton Class
  13.         return instance;
  14.     }
  15. }

Reply to "Singleton mode"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website