Which of the following statatement are true wort TreeMap? a TreeMap contains only unique keys b. TreeMap can contain duplicate keys. c TreeMap cannot have a null key d. TreeMap can have a null key e TreeMap maintains ascending order a f TreeMap maintains insertion order
Answers
Answered by
0
Answer:
a. TreeMap contains only unique keys
c. TreeMap cannot have a null key
e. TreeMap maintains ascending order
Explanation:
a,c,e statements are true with Treemap.
Answered by
0
Answer:
a) TreeMap contains only unique keys, c) TreeMap cannot have a null key and e) TreeMap maintains ascending order are true for TreeMap.
Explanation:
What is TreeMap:
- The Java TreeMap class is based on a red-black tree. It allows you to store key-value pairs in sorted order quickly.
Features of TreeMap:
The following are the key features of the Java TreeMap class:
- The key determines the values in a Java TreeMap. It extends the AbstractMap class and implements the NavigableMap interface.
- Only unique elements are found in the Java TreeMap.
- There can't be a null key in a Java TreeMap, but there can be numerous null values.
- TreeMap in Java is not synchronised.
- Ascending order is maintained via Java TreeMap.
Similar questions