Duration (Pacific Standard Time):
To (Pacific Standard Time):
Impact:
  • None
User Action:
  • None
 Collapse AllExpand All      Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: F# Code: JScript 

Object Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy.

System..::..Object
  All classes, structures, enumerations, and delegates.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
<SerializableAttribute> _
Public Class Object

The Object type exposes the following members.

  Name Description
Public method Object Initializes a new instance of the Object class.
Top
  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object.
Public method Static member Equals(Object, Object) Determines whether the specified object instances are considered equal.
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Public method GetHashCode Serves as a hash function for a particular type.
Public method GetType Gets the Type of the current instance.
Protected method MemberwiseClone Creates a shallow copy of the current Object.
Public method Static member ReferenceEquals Determines whether the specified Object instances are the same instance.
Public method ToString Returns a string that represents the current object.
Top

Languages typically do not require a class to declare inheritance from Object because the inheritance is implicit.

Because all classes in the .NET Framework are derived from Object, every method defined in the Object class is available in all objects in the system. Derived classes can and do override some of these methods, including:

  • Equals - Supports comparisons between objects.

  • Finalize - Performs cleanup operations before an object is automatically reclaimed.

  • GetHashCode - Generates a number corresponding to the value of the object to support the use of a hash table.

  • ToString - Manufactures a human-readable text string that describes an instance of the class.

Public static (Shared in Visual Basic) members of this type are thread safe. Instance members are not guaranteed to be thread-safe.