Object Class

Definition

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.

[Serializable]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class Object
Inheritance
Object

Constructors

Object()

Initializes a new instance of the Object class.

public Object()

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

public virtual bool Equals(object obj)
Parameters
obj
Object

The object to compare with the current object.

Returns

true if the specified object is equal to the current object; otherwise, false.

See Also

Equals(Object, Object)

Determines whether the specified object instances are considered equal.

public static bool Equals(object objA, object objB)
Parameters
objA
Object

The first object to compare.

objB
Object

The second object to compare.

Returns

true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.

See Also

Finalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

protected void Finalize()

GetHashCode()

Serves as the default hash function.

public virtual int GetHashCode()
Returns

A hash code for the current object.

See Also

GetType()

Gets the Type of the current instance.

public Type GetType()
Returns

The exact runtime type of the current instance.

See Also

MemberwiseClone()

Creates a shallow copy of the current Object.

protected object MemberwiseClone()
Returns

A shallow copy of the current Object.

ReferenceEquals(Object, Object)

Determines whether the specified Object instances are the same instance.

public static bool ReferenceEquals(object objA, object objB)
Parameters
objA
Object

The first object to compare.

objB
Object

The second object to compare.

Returns

true if objA is the same instance as objB or if both are null; otherwise, false.

See Also

ToString()

Returns a string that represents the current object.

public virtual string ToString()
Returns

A string that represents the current object.