About Question com.enthuware.ets.scjp.v6.2.19 :
Moderator: admin
About Question com.enthuware.ets.scjp.v6.2.19 :
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?
Re: About Question com.enthuware.ets.scjp.v6.2.19 :
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)
}
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)
}
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.19 :
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.
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.
Who is online
Users browsing this forum: No registered users and 242 guests