About Question enthuware.ocpjp.v7.2.1452 :

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

Moderator: admin

Post Reply
bluster
Posts: 60
Joined: Wed Apr 23, 2014 6:38 pm
Contact:

About Question enthuware.ocpjp.v7.2.1452 :

Post by bluster »

The API has the remove() method for the Map interface defined as such:
remove(Object key)
Removes the mapping for a key from this map if it is present (optional operation)
For the Collection interface we get this:
remove(Object o)
Removes a single instance of the specified element from this collection, if it is present (optional operation).
Finally, in option #3 we have this rendering for the method:
remove(Object o)
I ask why the setup above is compatible with the answer "The Map interface defines the methods remove()..." . It would seem that the method as rendered above (and in option #3) is closer to Collection than it is to Map.

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

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

Post by admin »

I am not sure I understand your question. If you are talking about key and o, then parameter names are irrelevant.
-Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests