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
Why do we use regex?
What is parsing a sentence?
What is final method?
What are different exception types exceptions available in java ?
What Is Query Throttling in java?
What is super?
Why heap memory is called heap?
What is the current version of java?
Can a method be overloaded based on different return type but same argument type?
What is data structure in java?
What state is a thread in when it is executing?
What is locale?
What is a memory leak in java?
How would you use Bubble Sort to sort the number of elements?
Why is it called a string?