Summary of method overloads, method overrides, method inheritance, etc. in Java

Source: Internet
Author: User

1. Specific specifications for method overloads (methods Overload)

If the method name of two methods is the same, but the parameters are inconsistent, then one method can be said to be overloaded with another method.

I. The method name must be the same. Two. The parameter table of the method must be different, including the type or number of parameters, to distinguish between different method bodies. 1. If the number of parameters is different, regardless of its parameter type! 2. If the number of arguments is the same, then the order of the parameters must be different. Three. The method's return type, modifiers can be the same, or different. Four. The main method can also be overloaded

Summary of method overloads, method overrides, method inheritance, etc. in Java

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.