GOA - System.Object

Object Class


Supports all classes in the framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes. It is the root of the type hierarchy.

Definition

public class Object

Members Table

MethodDescription
EqualsOverloaded. Compares two objects to determine if they are equal.
GetHashCodeServes as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetTypeGets the Type of the current instance.
ObjectInitializes a new instance of Object.
ReferenceEqualsDetermines whether the specified Object instances are the same instance.
ToStringReturns a String that represents the current Object.

Examples

// This sample shows how to use the Equals method in the Object class.

 

using System.Diagnostics;

 

public class SampleObject

{

     static void Main()

     {

          // Creates two objects.

          object myObject = "mine";

          object yourObject = "yours";

 

          // Determines the objects are equal.

          bool isEquals = Equals(myObject, yourObject);

          Debug.WriteLine("Compares myObject and yourObject: ---> " + isEquals);

          isEquals = Equals(myObject, myObject);

          Debug.WriteLine("Compares myObject and myObject: ---> " + isEquals);

          isEquals = Equals(myObject, null);

          Debug.WriteLine("Compares myObject and null: ---> " + isEquals);

          isEquals = Equals(yourObject, null);

          Debug.WriteLine("Compares yourObject and null: ---> " + isEquals);

          isEquals = Equals(null, null);

          Debug.WriteLine("Compares null and null: ---> " + isEquals);

     }

}

 

/*

The output of the sample.

 

Compares myObject and yourObject: ---> False

Compares myObject and myObject: ---> True

Compares myObject and null: ---> False

Compares yourObject and null: ---> False

Compares null and null: ---> True

*/

Class Information

NamespaceSystem
Flash Librarycorlib.scl
Flash Library Version2.0.0.2466
Silverlight LibrarySystem.Windows.Forms.dll



© 2003-2007 NETiKA Technologies. All rights reserved.