Method |
Access |
Function |
String tostring () |
Public Virtual |
String Representation of the returned object |
Int gethashtable () |
Public Virtual |
Returns a hash of an object. This object can efficiently search for instances of an object in some tables. |
Bool equals (Object OBJ) |
Public Virtual |
Compare instances of Objects |
Bool equals (Object obja, objectb) |
Public static |
Compare instances of Objects |
Bool referenceequal (Object obja , Object objb) |
Public static |
Compares whether two references point to the same object. |
Type GetType () |
Public |
Returns the details of the object type. |
Object menmberwiseclone () |
Protected |
Copy object |
Void finalize () |
Protected virtual |
It can be used to clean up resources. |
1. First, note that some methods are declared as virtual, because they will be overwritten in the user's own, while other methods cannot be rewritten, so they are not declared as virtual. Note that some methods are declared as protected. These methods are mainly used inside the class and are not part of the external interface.
2. The equals () method has two different versions, which have the same function but different calling methods. This is a feature of C #: the two methods have the same name, however, they can be separated by different parameters. This feature is called method rewriting.
3. GetType () returns an instance of the system. Type class. We will introduce it later.
4. The content returned by memberwiseclone () is somewhat different. Its return type is defined as an object, which is actually a system. Object Class. In C #, map this class. Therefore, an object is system. object.