What do the terms "underlying object" and "underlying implementation" mean?
(English is not my native language).
What do the terms "underlying object" and "underlying implementation" mean?
(English is not my native language).
By Underlying Object, we meant that the object that you are going to put into the map are going to be the same.
By Underlying implementation means, by using Map interface, you could inject HashMap or TreeMap or any other Map as long as it implements Map using Runtime polymorphism and making your code loosely coupled and designing by contract rather than by implementation.
Regarding the link you have mentioned: in the first case HashMap
is casted to a HashMap
while in the second case HashMap
is casted to a Map
. Though you will have two different access interfaces to those objects their underlying object (i.e. what they really are) is the same HashMap
.