What is HashMap and Map? Answer in order
-
Interface and Class
-
Class and Interface
-
interface and interface
-
class and class
B
Correct answer
Explanation
Map is an interface in Java that defines the contract for key-value mappings, while HashMap is a concrete class implementing that interface. The question asks for HashMap first, then Map.