using System;
class A 
{
             public static void Main(String [] args)
            {
                    B m = B.GetB(); 
                    m.j=100; //make changes to instance variable j
                    Console.WriteLine(m.j);
                    B x = B.GetB();                      //x.j print's 100 which means that there is one and only one Instance
                    Console.WriteLine(x.j);  }
}class B

              private static B x;
              public int j= 0; 
              private B()  
              {
              }
              public static B GetB() 
             {
                      if(x==null)
                     {
                            x=new B();
                     }
                      return x;
              }
}