About Question enthuware.ocpjp.v7.2.1527 :
Moderators: Site Manager, fjwalraven
-
- Posts: 5
- Joined: Thu Jan 02, 2014 3:36 am
- Contact:
About Question enthuware.ocpjp.v7.2.1527 :
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?
So Why option 2 and 3 are incorrect?
-
- Site Admin
- Posts: 10067
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
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.
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.
-
- Posts: 5
- Joined: Thu Jan 02, 2014 3:36 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
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.
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.
-
- Site Admin
- Posts: 10067
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
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.
-
- Posts: 97
- Joined: Wed Dec 28, 2016 9:00 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
Just a note:In a final class, only the methods are implicitly final but not
the declared fields.
the declared fields.
-
- Posts: 17
- Joined: Sun Sep 23, 2018 4:10 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
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.
-
- Posts: 21
- Joined: Tue Sep 09, 2014 3:28 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
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
Apart from this i totally love this enthuware though
-
- Site Admin
- Posts: 10067
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1527 :
Added the words, "without causing compilation failure" to make it clear.
thank you for your feedback!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 138 guests