About Question enthuware.ocajp.i.v7.2.907 :
Moderators: Site Manager, fjwalraven
About Question enthuware.ocajp.i.v7.2.907 :
If there is no visible constructor, the control, will not call default constructor for super class?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.907 :
Your question is not clear. If there is no visible constructor in which class? the super class or the subclass?
When you instantiate a sub class, the subclass's constructor is called and that constructor can invoke any constructor of its superclass. If subclass's constructor does not call super class's constructor explicitly, then the compiler puts a call to super(); as the first line of the subclass's constructor.
HTH,
Paul.
When you instantiate a sub class, the subclass's constructor is called and that constructor can invoke any constructor of its superclass. If subclass's constructor does not call super class's constructor explicitly, then the compiler puts a call to super(); as the first line of the subclass's constructor.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Fri Jan 03, 2014 10:59 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.907 :
Hi!
I have some doubts about:
"Note that if a subclass class constructor doesn't explicitly call the super class constructor, the compiler automatically inserts super(); as the first statement of the base class constructor. So option 5 is not needed."
I would say:
"Note that if a subclass class constructor doesn't explicitly call the super class constructor, the compiler automatically inserts super(); as the first statement of the subclass class constructor. So option 5 is not needed."
Peace.
I have some doubts about:
"Note that if a subclass class constructor doesn't explicitly call the super class constructor, the compiler automatically inserts super(); as the first statement of the base class constructor. So option 5 is not needed."
I would say:
"Note that if a subclass class constructor doesn't explicitly call the super class constructor, the compiler automatically inserts super(); as the first statement of the subclass class constructor. So option 5 is not needed."
Peace.
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.907 :
You are right. This has now been fixed.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 19 guests