Page 1 of 1

enthuware.ocajp.i.v7.2.934

Posted: Tue Feb 12, 2013 5:15 pm
by alex
You can call only public and protected constructors of the super class from a subclass if the subclass is not in the same package because only those are inherited.

Correct answer: No

We can`t call constructor of super class if constructor is private and we can`t call constructor of super class with "default" acessor (because another package).

So we have only two valid acessors public and protected. and anser have to be YES.

The question doesn`t implies inheritane of constructors. We just consider constructors of super class.

Re: enthuware.ocajp.i.v7.2.934

Posted: Tue Feb 12, 2013 5:30 pm
by admin
The question says "...because only those are inherited". You have to consider what the problem statement says in totality and then decide whether it is a true statement or not.
In this case, the above mentioned part is wrong because constructors are never inherited.

HTH,
Paul.

Re: enthuware.ocajp.i.v7.2.934

Posted: Tue Feb 12, 2013 11:50 pm
by alex
Yeah, it sounds reasonable.

Thanks,
Alex