Page 1 of 1
About Question enthuware.ocpjp.v7.2.1546 :
Posted: Thu Mar 06, 2014 1:32 am
by jaypi
No explaination for the answer.
Re: About Question enthuware.ocpjp.v7.2.1546 :
Posted: Thu Mar 06, 2014 1:48 am
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.
Re: About Question enthuware.ocpjp.v7.2.1546 :
Posted: Wed Oct 04, 2023 3:03 pm
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?
Re: About Question enthuware.ocpjp.v7.2.1546 :
Posted: Fri Oct 06, 2023 4:35 am
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.