About Question com.enthuware.ets.scjp.v6.2.19 :

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

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scjp.v6.2.19 :

Post by ETS User »

Nothing is said about the sub-class. The method can be abstract IF AND ONLY IF the sub-class is marked abstract. Is this really a OCPJP question for Oracle's lawyers or Java Programmers?

anangphatak

Re: About Question com.enthuware.ets.scjp.v6.2.19 :

Post by anangphatak »

Nothing is said about the sub-class. The method can be abstract IF AND ONLY IF the sub-class is marked abstract. Is this really a OCPJP question for Oracle's lawyers or Java Programmers?

Also note, It must return a Set can be interpreted as

SubClass extends Class_in_question {
public Set getSet(int a) {...} // method is returning a Set (or anything that IS-A set // covariant returns)
}

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

Re: About Question com.enthuware.ets.scjp.v6.2.19 :

Post by admin »

Hello,
The given answer is correct because as you mentioned there is a way the overriding method can be made abstract. Further, it is not necessary for the return type of the method to be Set as explained in the given comment. That is why this option is wrong.

HTH,
Paul.
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 242 guests