Multiple choice technology web technology

Difference between HashMap and Map?

  1. HashMap is Interface and Map is class that implements that.

  2. Both are interfaces

  3. Map is Interface and Hashmap is class that implements that.

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Java, Map is an interface that defines the contract for key-value mappings, while HashMap is a specific class that implements the Map interface using a hash table.