If your look at marco de colección you will see the following, but Map is not in the list of interfaces. While we talk about map we say it is a part of collection framework, so if Map is a part of collection framework then why it is not in the interfaces list.
java.util Interface Collection All Known Subinterfaces: BeanContext, BeanContextServices, List, Set, SortedSet All Known Implementing Classes: AbstractCollection, AbstractList, AbstractSet, ArrayList, BeanContextServicesSupport, BeanContextSupport, HashSet, LinkedHashSet, LinkedList, TreeSet, Vector
preguntado el 24 de agosto de 12 a las 08:08
"The collection framework" and
Collection interface are not the same thing.
Mientras que usted pueden regard a map as a collection of entries,
Map doesn't support that directly - you can get a set of entries with the
But fundamentally you need to distinguish between "the collection framework" and the
Collection de la interfaz del.
Maps trabajar con
key/value pairs, Mientras que el
other collections trabajar con
just values. Map maps keys to values. It allows its content to be viewed as a set of keys, a collection of values and a set of key-value mappings.
Check this following link. Answer by oracle. https://docs.oracle.com/javase/tutorial/collections/
It's part of the collection framework but it doesn't implement the
java.util.Collection de la interfaz del.
It's a different branch of the hierarchy. If you want, you can view it on the same level of the hierarchy as the Collection interface.
The Collection interface is implemented by (is the root of) List-like Collections while Map is implemented by(is the root of) the KEY-VALUE-like collections.
Because Map is three collections: Keys, values and key-value pairs.
It's not easy to decide which one should be the default to iterate over, so it implements the interface three times (
Map interface is not an extension of the
Collection interface. However, it is a structure for keeping collections of data.