Beginner Java with mind--inherit some notes

Source: Internet
Author: User

1. Inheriting classes require a default constructor in the parent class, and if super () can invoke the construction of the parent class, emphasizing super can remove the default constructor in the parent class. No super () implicitly invokes the default constructor of the parent class.
2. Subclasses inherit all the public properties and methods (except constructs) that are exposed by the parent class, and subclasses do not inherit the constructor of the parent class.
3. Constructs a call to construct the parent class, and then calls itself to be constructed (both called).
4.public Method (a) {
THIS.A (A is a property) =a (A is the above parameter);}
super--Parent Class
this--This class
this. property
This (); own method
5. Call the parent class construction method must be in the child class to construct the first line of the method, call with super, call this class constructor method must also be in the first row (this).

Beginner Java with mind--inherit some notes

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.