Execution sequence of the parent class subclass of the member variable Constructor

Source: Internet
Author: User

Vague concepts of written test questions:

Subclass member variable, subclass static member variable, subclass constructor, parent class member variable, parent class static member variable, execution sequence of parent class constructor.

Output result:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/150410L00-0.jpg "alt =" 08201233-1adceef845384154bde539c33618b15 "/>

 

Except the constructor, all sub-classes are executed before the parent class. The sequence of the sub-classes is static prior to the instance, and the variables are prior to the function. Then the sub-parent class instance functions are all last executed.


This article is from the "love IT" blog, please be sure to keep this source http://5563447.blog.51cto.com/5553447/1299873

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.