Object base class

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.