If set accepts only one argument then how can it compare
two objects to avoid duplicates
Answer Posted / r.jainrocks@gmail.com
Set compares hash code of new instance which
has to include in set with already containing values in Set.
because of this comparing b/w instances adding in set is slow
in Set and retrieval is fast.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can a class extends itself in java?
What is jit compiler in java?
Why use string handling in Java?
How do you join strings in java?
What is meant by flickering?
Who developed java?
What is the difference between dom and sax parser in java?
How many types of interfaces are there?
Why is multiple inheritance not supported in java?
In case of inheritance what is the execution order of constructor and destructor?
Why is logger singleton?
How do generics work?
List implementations of list interface?
Explain wait() method of object class ?
Why does java have two ways to create child threads?