Exemplo n.º 1
0
 public static singletoncheck getInstance()
 {
     if (sinletonObj == null)
     {
         return(sinletonObj = new singletoncheck());
     }
     else
     {
         return(sinletonObj);
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            InheritanceConfusion objInheritanceConfusion = new InheritanceConfusion();

            singletoncheck objSingletonCheck = singletoncheck.getInstance();
            int            a = 10, b = 30;

            Console.WriteLine(a.isGreaterThan(b));

            objSingletonCheck.printMessage();
        }