CLR requires that each type is ultimately derived from the object type, as follows:
class Typer {} === class Typer :object {}
The above is exactly equal.
All types are ultimately derived from object, and each type has a set of basic methods:
Equals: Return True if two objects are equal
GetHashCode: Returns a hash code of the object value
ToString: The default return type full name, int and other types are rewritten
GetType: Returns the type of the object called
Additionally, the protected method can be accessed by derived types from the object
MemberWiseClone: Return a new real class
Finalize: virtual method, called before memory recycling
CLR requires that all objects be created with the NEW operator:
1. Calculate the type and all its base types, and some additional members
2. Allocation of the specified type required bytes from the heap
3. Call the instance constructor of the type and pass it into any actual parameters specified in the call to New.
When calling each type constructor, it is responsible for initializing the instance field defined by this type and finally calling the object's constructor.
After new is executed, a reference to the new object is returned.
class Typer {} === class Typer :object {}
The above is exactly equal.
All types are ultimately derived from object, and each type has a set of basic methods:
Equals: Return True if two objects are equal
GetHashCode: Returns a hash code of the object value
ToString: The default return type full name, int and other types are rewritten
GetType: Returns the type of the object called
Additionally, the protected method can be accessed by derived types from the object
MemberWiseClone: Return a new real class
Finalize: virtual method, called before memory recycling
CLR requires that all objects be created with the NEW operator:
1. Calculate the type and all its base types, and some additional members
2. Allocation of the specified type required bytes from the heap
3. Call the instance constructor of the type and pass it into any actual parameters specified in the call to New.
When calling each type constructor, it is responsible for initializing the instance field defined by this type and finally calling the object's constructor.
After new is executed, a reference to the new object is returned.