About Question enthuware.ocajp.i.v7.2.1135 :

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

Moderator: admin

Post Reply
zoharch
Posts: 4
Joined: Fri Sep 29, 2017 3:34 pm
Contact:

About Question enthuware.ocajp.i.v7.2.1135 :

Post by zoharch »

"Subclasses must define all the abstract methods that the superclass defines."
"A class implementing an interface must define all the methods of that interface
."

What does it mean "define".
They should implement all the abstract methods isn't it ?

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

Re: About Question enthuware.ocajp.i.v7.2.1135 :

Post by admin »

Yes, define means the same as implement.
If you like our products and services, please help us by posting your review here.

myEtsUsername
Posts: 2
Joined: Sun Sep 30, 2018 12:03 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1135 :

Post by myEtsUsername »

I feel this question is written ambiguously.
Admin says "define means the same as implement".
If that's true, and we replace all instances of the word 'define' with 'implement' it turns the first answer from this:
Subclasses must define all the abstract methods that the superclass defines.
into this:
Subclasses must implement all the abstract methods that the superclass implements.
which is meaningless since abstract methods are by definition not implemented. Furthermore, the word "define" in this question could just as easily be understood to mean "declare":
Subclasses must declare all the abstract methods that the superclass declares.
This awkward phrasing, but seems as plausible as any alternative. In any case, the confusion stems from the word "define" being used to mean two different things in the same sentence.

Thanks

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

Re: About Question enthuware.ocajp.i.v7.2.1135 :

Post by admin »

The question and the explanation are fine. There is a difference between declaration and definition with respect to methods in Java. And definition does mean the same as implementation in this case.
I feel this question is written ambiguously.
Admin says "define means the same as implement".
If that's true, and we replace all instances of the word 'define' with 'implement' it turns the first answer from this:
Subclasses must define all the abstract methods that the superclass defines.
into this:
Subclasses must implement all the abstract methods that the superclass implements.
which is meaningless since abstract methods are by definition not implemented.
It is actually a wrong option but not really completely meaningless. A language could force a subclass to implement all abstract methods of the superclass. Java does not impose such rule. Java does not require a subclass to implement abstract methods of it superclass but in that case it requires the subclass to be declared as abstract. That is what the explanation also says.

Further, an incorrect option doesn't have to make sense. It could be completely meaningless also. Although that is not the case here.

Irrespective of how you read this option, it is unambiguously an incorrect option.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 46 guests