Use the inherited Object methods : System.Object : Class C# Examples


C# Examples » Class » System.Object »

 

Use the inherited Object methods









    
using  System;

class  MainClass
{
        public  static  void  Main(string[]  args)
        {
        MainClass  c1  =  new  MainClass();

        MainClass  c2  =  c1;
        object  o  =  c2;
        
        if(o.Equals(c1)  &&  c2.Equals(o))
            Console.WriteLine("Same  instance!\n");

        }
}
    
   
  
   



Output

Same instance!


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» System.Object