Examveda
Examveda

What is the primary difference between a `HashMap` and a `TreeMap` in the Java Collections Framework?

A. A `TreeMap` uses a linked list to store elements

B. A `HashMap` is synchronized, while a `TreeMap` is not

C. A `TreeMap` allows duplicate keys, while a `HashMap` does not

D. A `HashMap` does not maintain order, while a `TreeMap` does

Answer: Option D


This Question Belongs to Java Program >> Collections Framework In Java

Join The Discussion

Related Questions on Collections Framework in java