Example #1
0
        public static void main(string[] args)
        {
            singletonclass singleto = singletonclass.getinstances();

            singleto.somemethod();

            singletonclass single2 = singletonclass.getinstances();

            single2.somemethod();
        }
Example #2
0
 public static singletonclass getinstances()
 {
     if (_instance != null)
     {
         return(_instance);
     }
     else
     {
         _instance = new singletonclass();
         return(_instance);
     }
 }