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.
About Question enthuware.ocpjp.v8.2.1251 :
Moderators: Site Manager, fjwalraven
-
- Posts: 17
- Joined: Thu Oct 01, 2015 4:06 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1251 :
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.
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.
-
- Posts: 27
- Joined: Fri Jul 22, 2016 9:14 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1251 :
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.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1251 :
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!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 2 guests