Hello,
For this question, you have marked that line //3 is causing a compilation error as a correct answer. But I think it actually is line //4 with that correct explanation as well.
Line //3 is abstract class PowerTool implements Tool{ } //3
So a call implements an interface (Tool) .. This is correct
Line //4 is : class PowerSaw implements PowerTool{ //4
So class implements a class... this is not correct.
So in my opinion, line 4 not line 3 is causing a problem here.
Please let me know your opinions.
Thank you,
Laurentiu
About Question enthuware.ocpjp.i.v11.2.3041 :
Moderators: Site Manager, fjwalraven
-
- Posts: 2
- Joined: Tue Apr 30, 2019 6:49 am
- Contact:
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3041 :
You are right. The explanation is correct but belongs to line 4 instead of 3.
thank you for your feedback!
thank you for your feedback!
-
- Posts: 26
- Joined: Wed Oct 02, 2019 1:42 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3041 :
The first line of the explanation for why //4 would cause an error, while correct, doesn't seem to apply to the actual question:
It seems like it would be better to say (changes in bold)
But that bit is about this line, which neither extends something nor mentions an interface:A class cannot "extend" an interface. It can only "implement" it.
Code: Select all
class PowerSaw implements PowerTool{ //4
A class cannot "implement" another class. It can only "extend" it.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3041 :
You are right. Fixed.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 12 guests