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
What is the purpose of the Java Collections Framework?
A. To provide a unified architecture for representing and manipulating collections
B. To provide a way to create arrays
C. To define primitive data types
D. To handle exceptions
A. `Collection`
B. `Map`
C. `Set`
D. `List`
What is the primary difference between a `List` and a `Set` in the Java Collections Framework?
A. A `Set` allows duplicate elements, while a `List` does not
B. A `List` is unmodifiable, while a `Set` is modifiable
C. A `List` allows duplicate elements, while a `Set` does not
D. A `Set` is indexed, while a `List` is not
Which class is typically used to implement a `List` in the Java Collections Framework?
A. `HashMap`
B. `ArrayList`
C. `LinkedList`
D. `HashMap`
Join The Discussion