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 you change array size in java?
What is the meaning of find and replace?
what are the states associated in the thread? : Java thread
What is the purpose of format function?
How do you remove duplicates in java?
Why is java multithreaded?
What are the differences between processes and threads?
What is the use of runnable interface?
Why put method is used?
How can you say java is object oriented?
What is the basic concepts of OOPS?
How does list work in java?
What do you mean by an object in java?
What is a nonetype?
Explain notify() method of object class ?