why the equals method can be override?when we override the
equals method?
Answer Posted / madhu
equals() method will be available in primodian class that is
Object class, but by default it compares only the addresses,
not the contents, So if you want the content comparison you
have to override equals(), but if u override the equals(),
you have to override the hashCode() also.
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
What is reverse function?
What are synchronized methods and synchronized statements in java programming?
Which is bigger float or double java?
How do you override a method?
What are advantages of exception handling in java?
Explain all java features with real time examples
Can we serialize static variables in java?
What data type is string java?
What is temp in java?
What is the difference between java applets and applications?
What does @override mean?
What is a conditional statement explain with example?
What are parsing rules?
Are arrays primitive data types?