Which of the collections allows null as the key?



Which of the collections allows null as the key?..

Answer / Ankita Mishra

In Java, neither HashMap nor any other standard collection allows a `null` key. However, you can use LinkedHashMap or TreeMap with a custom Comparator to allow null keys, if needed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Why is it called bubble sort?

1 Answers  


State the difference between persistent and ephemeral data structure?

1 Answers  


Tell me why might quick sort might be better than merge sort?

1 Answers  


Who invented quicksort?

1 Answers  


What data structure underlies a python list?

1 Answers  


List the applications of stacks?

1 Answers  


What is an expression tree?

1 Answers  


Can we add duplicate keys in a hashmap? What will happen if we attempt to add duplicate values?

1 Answers  


How many times is merge sort called?

1 Answers  


Why is the isempty() member method called?

1 Answers  


What is the quickest sorting algorithm?

1 Answers  


What is the use of bubble sort?

1 Answers  


Categories