About Question enthuware.ocpjp.v8.2.1251 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
RAZER-KIEV
Posts: 17
Joined: Thu Oct 01, 2015 4:06 pm
Contact:

About Question enthuware.ocpjp.v8.2.1251 :

Post by RAZER-KIEV »

What does it means in exploration
"Further, it is given that A declares a method but does not implement it, that means, it MUST be an abstract class.
"
Interfaces, of course, can declare a method but doesn't implement it.

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

Re: About Question enthuware.ocpjp.v8.2.1251 :

Post by admin »

You are right and that is what the explanation also says, "Since Java 8 allows interfaces to contain method implementation as well, that means it can be a class or an interface. ".
The second sentence is incorrect. I think the author meant that if it is a class, it must be an abstract class. I have updated it.
thank you for your feedback!
Paul.

badbishop
Posts: 27
Joined: Fri Jul 22, 2016 9:14 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1251 :

Post by badbishop »

Without knowing whether A implements either {default|static} process(){}, or just process(){}, it is impossible to tell, can A also be an interface or not. IMHO, the most natural assumption would be process(){}. But, of course, that will spell the answer out in the question itself.

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

Re: About Question enthuware.ocpjp.v8.2.1251 :

Post by admin »

That is correct. You cannot be sure whether it is an interface or not by just process. That is why the correct option is "interface or abstract class".
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests