The principles that the Java method invocation procedure follows __class

Source: Internet
Author: User

Principles that Java method invocation procedures follow

1 First Java class files, calls to all methods are recorded through symbolic constants.

The relevant content can be obtained through the analysis of class file

2 Find the corresponding method in the corresponding class according to the static type of the variables and the static types of the parameters.

Find the best method based on the rules of overload overload,

If the method is found to be a static method, a final method, or a private method, remember that the address of this method ends.

If not, it is possible to override the subclass, which corresponds to the class of the actual type of the variable based on the signature of the method

To find the corresponding method by querying the order of the parent class in the first query subclass.

Summarize

Implemented using static multiple allocations plus dynamic single dispatch.

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.