If set accepts only one argument then how can it compare
two objects to avoid duplicates
Answer Posted / ashutosh
for comparison between two objects of the same class, class
must override equals() and hashcode() methods of the object
class.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What are different types of classloaders?
What is string args [] in java?
What type of variable is gender?
Is object a data type in java?
How do you do a line break in java?
What is not object oriented programming?
Is main is a keyword?
How does queue work in java?
Explain public static void main(string args[]) in java.
What do you mean by stack?
How can you share data between two thread in Java?
What is difference between this and super keyword?
What happens if an exception is throws from an object's constructor?
What is static keyword in java?
Can we pass a primitive type by reference in java? How