What is the difference between Map and HashMap in java
Can you please explain the difference between map and hashmap?
How they are different from each other?
Here we have map vs hashmap java
The map is an interface and has two implementation
Tree Map
Hash Map
Hash map:
It is the implementation of map interface.
It can contain null values and keys.
It doesn't maintain input order.
The map is an interface and has two implementation
TreeMap
Tree Map maintains the input order .
It will not allow any null values.
Duplicate keys are not allowed in the map