About Question enthuware.ocpjp.v7.2.1527 :

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
jimi24
Posts: 5
Joined: Thu Jan 02, 2014 3:36 am
Contact:

About Question enthuware.ocpjp.v7.2.1527 :

Post by jimi24 »

If we add abstract keyword in their class definition the class will become abstract and hence not defining body of method m1 is fine.

So Why option 2 and 3 are incorrect?

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

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by admin »

Did you read the explanation for option 2? Same is the case with option 3.
You need to specify the keyword abstract if you don't have a body for the method.
If you like our products and services, please help us by posting your review here.

jimi24
Posts: 5
Joined: Thu Jan 02, 2014 3:36 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by jimi24 »

Yes, I read the explanation. But the question was "Which of the following classes can be made abstract just by adding the keyword abstract in their class declaration?"

And if we add abstract keyword in the class definition of code snippet of option 2 and 3 they will become abstract class and compile. Don't they satisfy criteria of the question?

The question didn't say they should be a valid compilable code before adding abstract keyword. They become valid compilable code after adding abstract keyword.

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

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by admin »

For these options, you will need to add it to the method declarations as well. So they do not satisfy the requirement given in the problem statement because the question says, ".... in their class declaration" not "in their class definition".
If you like our products and services, please help us by posting your review here.

jagoneye
Posts: 97
Joined: Wed Dec 28, 2016 9:00 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by jagoneye »

Just a note:In a final class, only the methods are implicitly final but not
the declared fields.

floryan
Posts: 17
Joined: Sun Sep 23, 2018 4:10 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by floryan »

admin wrote:
Thu Jan 02, 2014 4:33 am
Did you read the explanation for option 2? Same is the case with option 3.
You need to specify the keyword abstract if you don't have a body for the method.
To be precise the question only asks how the classes can be made abstract and does not ask for them to compile. It would be good to specify that aspect too.

jbilkes
Posts: 21
Joined: Tue Sep 09, 2014 3:28 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by jbilkes »

i totally agree with the above comments on vague questioning....there is no mention to compile or not as is, without adding abstract, so why bother about that. Believe me, this is just plain wrong questioning. And don't tell me the word 'class' applies to compiling classes only haha

Apart from this i totally love this enthuware though ;)

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

Re: About Question enthuware.ocpjp.v7.2.1527 :

Post by admin »

Added the words, "without causing compilation failure" to make it clear.

thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests