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
What is meant by attribute?
Implementations of set interface?
Is it compulsory for a try block to be followed by a catch block in java for exception handling?
Can constructor return value?
how to convert Java project into Maven ?
What is the mapping mechanism used by java to identify IDL language?
What do bitwise operators do?
Is string a class in java?
Does the order of public and static declaration matter in main method?
Which variables are stored in heap?
What is hasnext in java?
Can java arraylist hold different types?
How to use string tokenizer class.
What is this keyword in java?
What is an eror in java?