Explanation of overloading of Java methods

Source: Internet
Author: User
1. Overloading of methods:

The method name is the same, and the parameter list is called the overloaded method.

      

      

2. How to correctly differentiate the method is different:

1. See if the method name is the same, the method name is different method

2. See if the parameter list is the same. The differences in the parameter list are divided into two parts: a. The number of arguments is different B. The data type of the parameter is different.

Attention:

A. The overloads of the method are independent of the return value/modifier list.

B. If the method name is the same and the argument list is the same, then this method is duplicated and is an error.

      

3. How the method is executed:

The method does not call not execute, a call is executed, and the result of the call is returned to the method's call.

4. Calls from the memory data structure parsing method:

The method will not partition the method in memory when it is called, and if the method does not call it, it will not divide the space in memory.

method is called "stack", the end of the method is "stack".

    

Memory Brief Analysis:

     

Explanation of overloading of Java methods

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.