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
Explain public static void main(string args[]).
What is a superclass?
What is meant by object oriented programming – oop?
Is vector synchronized in java?
What is methods in java?
What is native method in java?
What are "methods" and "fields"?
What is an example of a constant variable?
How do I start learning java?
Describe the syntax of multiple inheritance? When do we use such an inheritance?
What is meant by class and object in java?
Can we declare an interface as final?
When will we prefer to use set and list in java and why?
What is the abstraction?
What is parsing in java?