Method of Object Class
|
Meaning in Life
|
Equals()
(Public, Overloads, Overridable)
|
By default this method will return true only if the items being compared refer to the exact same item in memory. Thus, Equals() is used to compare object references, not the state of the internal member variables. Typically, you will override this to return true only if the items being compared have the same internal state values. If you override GetHashCode(), you should also override Equals().
|
Equals()
(Public, Overloads, Shared)
|
Compares two objects and returns true if they are equal.
|
ReferenceEquals()
(Public, Shared)
|
Compares two object references and returns true if they refer to the same instance.
|
GetHashCode()
(Public, Overridable)
|
By default, returns an integer that identifies a specific object instance. Override to return an integer that identifies a specific object value.
If you override Equals(), you should also override GetHashCode().
|
GetType()
(Public)
|
Returns a Type object, which describes the sort of object you are currently referencing. In short, this is a Runtime Type Identification (RTTI) method available to all objects (more later).
|
ToString()
(Public, Overridable)
|
Returns a string representation of this object using the “<namespace>.<class name>” format (termed the fully qualified name). If the type has not been defined within a namespace, <class name> alone is returned.
You typically override this to return a tokenized string of name/value pairs that represent the object’s internal state rather than its fully qualified name. Great for tracing purposes.
|
Finalize()
(Protected, Overridable)
|
Called to free any allocated resources before the object is destroyed.
|
MemberwiseClone()
(Protected)
|
Performs a shallow copy of the current object. In other words, each value field in the original is copied into the new instance. However, each reference field in the new instance is set to refer to the same object as the field in the original.
|