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 difference between static and abstract class?
Can a vector contain heterogenous objects?
What is java life cycle?
What is main function purpose?
How do you get the length of a string in java?
How does split work in java?
Which package has light weight components?
What is unsigned char?
How many wrapper classes are there in java?
What is difference between jdk,jre and jvm?
Can constructor be static or final?
What is parse method?
Are arrays dynamic in java?
Add a value x to array from index l to r where 0 <= l <= r <= n-1
Why there are some null interface in java? What does it mean?