1.

While finding the correct location for saving key value pair, how many times the key is hashed?(a) 1(b) 2(c) 3(d) unlimited till bucket is foundI have been asked this question during an interview for a job.This interesting question is from Data Structures-HashMap in chapter java.util – The Collections Framework of Java

Answer»

The CORRECT choice is (B) 2

Explanation: The key is hashed twice; FIRST by hashCode() of Object CLASS and then by internal hashing method of HASHMAP class.



Discussion

No Comment Found

Related InterviewSolutions