About Question enthuware.ocpjp.v7.2.1305 :

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
tn1408
Posts: 28
Joined: Wed Dec 04, 2013 7:57 pm
Contact:

About Question enthuware.ocpjp.v7.2.1305 :

Post by tn1408 »

Could this method: public boolean add(Object o) be overloading the method: public boolean add(E e) of the ArrayList class?

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

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

Post by admin »

What happened when you tried it out ?
-Paul.

dhunziker
Posts: 3
Joined: Wed Aug 07, 2013 4:39 pm
Contact:

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

Post by dhunziker »

The actual compiler error is probably quite helpful here:

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
You can still override the method using Book or overload it by using a type other than Object.

ewebxml
Posts: 77
Joined: Sun Jun 30, 2013 10:04 pm
Contact:

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

Post by ewebxml »

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.

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

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

Post by admin »

Fixed.
Thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests