About Question enthuware.ocpjp.v7.2.1305 :
Moderators: Site Manager, fjwalraven
-
- Posts: 28
- Joined: Wed Dec 04, 2013 7:57 pm
- Contact:
About Question enthuware.ocpjp.v7.2.1305 :
Could this method: public boolean add(Object o) be overloading the method: public boolean add(E e) of the ArrayList class?
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1305 :
What happened when you tried it out ?
-Paul.
-Paul.
-
- Posts: 3
- Joined: Wed Aug 07, 2013 4:39 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1305 :
The actual compiler error is probably quite helpful here:
You can still override the method using Book or overload it by using a type other than Object.
Code: Select all
Name clash: The method add(Object) of type BookList has the same erasure as add(E) of type ArrayList<E> but does not override it
-
- Posts: 77
- Joined: Sun Jun 30, 2013 10:04 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1305 :
The explanation for option d) should say:
"Observe that BookList extends a typed ArrayList" instead of
"Observer that BookList extends a typed ArrayList".
Please confirm.
"Observe that BookList extends a typed ArrayList" instead of
"Observer that BookList extends a typed ArrayList".
Please confirm.
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1305 :
Fixed.
Thank you for your feedback!
Thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 5 guests