About Question enthuware.ocpjp.v7.2.1546 :

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

Moderator: admin

Post Reply
jaypi
Posts: 8
Joined: Sun Feb 03, 2013 9:47 am
Contact:

About Question enthuware.ocpjp.v7.2.1546 :

Post by jaypi »

No explaination for the answer.

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

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

Post by admin »

All name-value maps such as HashMap and TreeMap implement java.util.Map and all collections such as ArrayList, and LinkedList implement java.util.Collection.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

gurban.azimli
Posts: 3
Joined: Wed Oct 04, 2023 2:56 pm
Contact:

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

Post by gurban.azimli »

In the question, it's asked what is the root interface for all collection-related interfaces?
As we know HashMap, LinkedHashMap, and TreeMap are not interfaces can we consider the correct answer only as Collection?

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

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

Post by admin »

Maps and lists/sets are part of a broader "collections api" but they don't have a common interface. The root interface for maps is Map and for list/set is Collection.
What option(s) you should select depends on the problem statement and the number of options you have to select. In this question, it asks you to select two interfaces and it also says "all collection related interfaces". Although HashMap is not an interface, but Map is.

Generally, there is no need to read between the lines for such questions. Just go with the most obvious interpretation.
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 240 guests