why the equals method can be override?when we override the
equals method?

Answer Posted / subhareddy

equals method available in object class is for address
comparison not for content comparison.so for content
comparison we have to override equals method in our class.
wrapper classes and string class has overridden equals
method for content comparison.

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why java strings are immutable in nature?

594


When should I use singleton pattern?

545


How does queue work in java?

532


What is the maximum length of a url?

513


Program to Find the second largest element in an array.

591






How do you achieve polymorphism in java?

523


How to access arraylist elements in java?

494


Explain the importance of finally block in java?

569


What should I import for arraylist in java?

510


What is difference between static and final?

561


Is there any sort function in java?

577


What is supplier in java?

560


What are the two types of java?

519


Explain the meaning of java applet.

606


What is dynamic array in java?

528