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 SimpleTimeZone class?
What is the differences between heap and stack memory in java? Explain
Can we have this () and super () together?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
What are the two types of java programming?
Difference between comparator and comparable in java?
What is the purpose of void?
What is the purpose of the strictfp keyword?
How to make a non daemon thread as daemon?
What is square root in java?
What are thread local variables?
How does system arraycopy work in java?
What does indexof return in java?
What is java literals?
List implementations of list interface?