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.
public class Object
// 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
*/
Namespace System Flash Library corlib.scl Flash Library Version 2.0.0.2466 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |