Junior — Middle
Is HashMap an implementation of the Collection interface in Java?
sobes.tech AI
Answer from AI
HashMap in Java is not an implementation of the Collection interface. HashMap implements the Map interface, which is designed for storing key-value pairs. The Collection interface is intended for collections of elements without keys, such as List, Set, and Queue. Therefore, HashMap is not part of the Collection hierarchy but exists separately as an implementation of Map.