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
How do you use substring in java?
Can we change the value of static variable?
Write a program to show whether a graph is a tree or not using adjacency matrix.
In how many ways we can create threads in java?
What does three dots mean in java?
What is lambda in java?
Does garbage collection occur in permanent generation space in jvm?
Can I declare class as static or private?
Explain the importance of finally over return statement?
What is the destroy method?
Is java a pure object oriented language?
How to find the largest value from the given array.
Why is whitespace important?
Why java is platform independent? Explain.
Who is founder of java?