The construction method of Java essay

Source: Internet
Author: User

When Java is in the new object,

First, it creates a space in memory based on the size of the class, initializing the line data

Next, the constructor method is called, and the corresponding assignment is made.

For the construction method, I have 2 words.

1, if there is an inheritance relationship, then the construction method of the parent class must be called (that is, a parent class must be produced).

2, first call the parent class construction method, and then call the subclass construction method. When the system receives our message that it wants to new a class, it first finds the parent class of the class, then finds the parent class, until the head is found, and then starts from the topmost parent class, until we have the new class.

The construction method of Java essay

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.