Basic summary of Java object-oriented programming

Source: Internet
Author: User


1 Methods of inheritance time rewrite:

When a subclass intends to override the method of the parent class, it cannot narrow the access rights of the method, or the compiler does not pass.

2 instantiation of subclasses inheriting parent classes:

When the subclass is in the instance session, regardless of whether the child class is instantiated with parameters, the compiler always calls the parent class's parameterless construction method, and then calls the constructor of the sub-class corresponding parameter;

3 About method Invocation methods:

Static methods that allow only static methods to be called, and instance methods that allow both static and non-static methods to be called directly.




Basic summary of Java object-oriented programming

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.