Class Object
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.
Inheritance
Namespace: System
Assembly: mscorlib.dll
Syntax
public class Object
Constructors
| Improve this Doc View SourceObject()
Initializes a new instance of the Object class.
Declaration
public Object()
Methods
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public extern virtual bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | he object to compare with the current object. |
Returns
Type | Description |
---|---|
Boolean | true if the specified object is equal to the current object; otherwise, false. |
Equals(Object, Object)
Determines whether the specified object instances are considered equal.
Declaration
public static bool Equals(object objA, object objB)
Parameters
Type | Name | Description |
---|---|---|
Object | objA | The first object to compare. |
Object | objB | The second object to compare. |
Returns
Type | Description |
---|---|
Boolean | true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true. |
GetHashCode()
Serves as the default hash function.
Declaration
public extern virtual int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for the current object. |
GetType()
Gets the Type of the current instance.
Declaration
public extern Type GetType()
Returns
Type | Description |
---|---|
Type | The exact runtime type of the current instance. |
Remarks
Available only in mscorlib build with support for System.Reflection.
MemberwiseClone()
Creates a shallow copy of the current Object.
Declaration
protected extern object MemberwiseClone()
Returns
Type | Description |
---|---|
Object | A shallow copy of the current Object. |
ReferenceEquals(Object, Object)
Determines whether the specified Object instances are the same instance.
Declaration
public static extern bool ReferenceEquals(object objA, object objB)
Parameters
Type | Name | Description |
---|---|---|
Object | objA | The first object to compare. |
Object | objB | The second object to compare. |
Returns
Type | Description |
---|---|
Boolean | true if objA is the same instance as objB or if both are null; otherwise, false. |
ToString()
Returns a string that represents the current object.
Declaration
public virtual string ToString()
Returns
Type | Description |
---|---|
String | A string that represents the current object. |
Remarks
Available only in mscorlib build with support for System.Reflection.