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
What is methodological framework?
What is the use of generics? When was it added to the Java development Kit?
Why are parameters used in functions?
what is method reference in java 8?
What is role of void keyword in declaring functions?
What is the synonym of procedure?
'A class is a template for an object' explain this statement.
What is array initialization in java?
What are the differences between heap and stack memory in java?
Explain about static nested classes in java?
What is the functionality of the stub?
What is a line break example?
Can we overload destructor in java?
Explain parallel processing in java8?
what is the significance of listiterator in java?