A question about static-extends

Source: Internet
Author: User

A question about static-extends

A question about static-extends

/** * * @title:Child.java * @Package:com.you.hbxs.model * @Description:
One-sentence description function * @ author: * @ date: 10:10:48 * @ version V1.0 **/package com. you. hbxs. model;/***** Project name: HBXS * Class Name: Child * class description: * Creator: * Creation Time: 10:10:48 * modifier: * modification time: 10:10:48 * modification remarks: * @ version V1.0 **/class Parent {/***

Title:

*

Description:

*/Public Parent () {System. out. println ("Parent") ;}{ System. out. println ("I'm your parent! ");} Static {System. out. println (" static Parent! ") ;}}/***** Project name: HBXS * Class Name: Child * class description: * Creator: * Creation Time: 10:41:41 * modifier: * modification time: 10:41:41 * modification remarks: * @ version V1.0 **/public class Child extends Parent {/***

Title:

*

Description:

*/Public Child () {System. out. println ("Child") ;}{ System. out. println ("I'm your child! ");} Static {System. out. println (" static Child! ");}/***** Method Name: main * method type: Child * parameter: @ param args * @ return: void * @ throws */public static void main (String [] args) {System. out. println ("-------- start -----------"); new Child (); System. out. println ("-------- end -----------") ;}} running result:
Static Parent! Static Child! -------- Start ----------- I'm your parent! ParentI'm your child! ChildI'm your parent! ParentI'm your child! Child -------- end -----------

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.