Java MCQ: Which of the following is true about the LinkedHashMap class?
a) It maintains insertion order
b) It is a subclass of HashMap
c) It allows null values
d) All of the above
Answer:
d) All of the above
Explanation:
The LinkedHashMap
class in Java maintains the insertion order of elements, is a subclass of HashMap
, and allows null values. It combines the performance of a HashMap
with predictable iteration order.
Understanding LinkedHashMap
is crucial for applications where both performance and order preservation are important.
Reference links:
https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html