using equals method overriding which objects are
compared?i.e same class objects or other class
objects?Explain me.
Answer Posted / r.jainrocks@gmail.com
we compare with same class object...
let me know when u override equals() method
u code like--->
this.name.equals(obj.name);
so this comparison is with same class object not with
other class.....
if there is other class class object then
ClassCastException may occur due wrong casting...
so be careful while using equals method overriding....
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the range of the short type?
How do you remove duplicates from an array in java?
What is the Difference between Final Class && Abstract Class?
Which class represents the socket that both the client and server use to communicate with each other?
Explain numeric promotion?
What is your platform?s default character encoding and how to know this?
What are format specifiers in java?
What are the differences between stringbuffer and stringbuilder?
What is callablestatement? How you can call stored procedure to pass in parameter?
why we use merge option in hybernate pls give a ex snippet
What is class and object in java?
What is a method signature java?
Can we assign null to double in java?
What are the four corner stones of oop?
Is overriding possible in java?