1.

Is hashmap an ordered collection.(a) True(b) FalseI had been asked this question during an interview.Origin of the question is Data Structures-HashMap topic in chapter java.util – The Collections Framework of Java

Answer»

Right choice is (b) False

Easy explanation: Hashmap outputs in the order of HASHCODE of the keys. So it is UNORDERED but will ALWAYS have same result for same set of keys.



Discussion

No Comment Found

Related InterviewSolutions