Single and multi-assignment, distribution

Source: Internet
Author: User

Single and multi-assignment, distribution

The caller type (parent type) of the method is called the static type. The caller's final type (its own type) is called the actual type.

When the method version is determined by the caller's actual type + type in the method parameter, this assignment is called multi-Dispatch. It is called single dispatch Based on the caller and method parameters.

The assignment is based on the method version determined by the type.

Java supports static multi-assignment and dynamic single-assignment.

First, static assignment occurs in the compilation phase. In the compilation phase, if you want to determine the method version, you need to know the caller's actual type and parameter type. Therefore, it is multi-allocation.

Multi-Dispatch occurs in the compilation phase. Because the actual type of the parameter is known after compilation, you only need to know the actual type of the method caller to determine the unique version of the method, therefore, Dynamic assignment must be a single assignment.

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.