The difference between overloading in Java and overriding abstract classes and interfaces

Source: Internet
Author: User

. The difference between overloading and overriding:
Heavy Duty (Overload) | Override (Override)
1 methods have the same name, number of parameters, different types | Method name, argument list, return value type exactly the same as the parent class
2 Access range for methods not required | The scope of the overridden method provided by the subclass cannot be smaller than in the parent class
3 application in the interior of a class | Applied in the inheritance relationship of the parent-child class

. The difference between an abstract class and an interface:
Abstract Class | Interface
1 Structural Methods | No construction method
Methods in the 2 class are not necessarily abstract methods | All methods in an interface are abstract methods
3 multiple inheritance not allowed | Multiple inheritance allowed

The difference between overloading in Java and overriding abstract classes and interfaces

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.