object class

The object class has the following members:


public class Object
{
  public Object();
  
  public extern Type GetType();
  
  public virtual bool Equals (object obj);
  public static bool Equals  (object objA, object objB);
  public static bool ReferenceEquals (object objA, object objB);
  
  public virtual int GetHashCode();
  
  public virtual string ToString();
  
  protected override void Finalize();
  protected extern object MemberwiseClone();
}

object(System.Object) is the super class for all types.

We can always cast to object.


using System;

class Rectangle{
   
}

class Program
{
    static void Main(string[] args)
    {

        object o = new Rectangle();
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.