enthuware.ocajp.i.v7.2.934

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
alex
Posts: 42
Joined: Tue Feb 12, 2013 4:35 pm
Contact:

enthuware.ocajp.i.v7.2.934

Post 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.

Online
admin
Site Admin
Posts: 10066
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: enthuware.ocajp.i.v7.2.934

Post 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.
If you like our products and services, please help us by posting your review here.

alex
Posts: 42
Joined: Tue Feb 12, 2013 4:35 pm
Contact:

Re: enthuware.ocajp.i.v7.2.934

Post by alex »

Yeah, it sounds reasonable.

Thanks,
Alex

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 243 guests