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 about interrupt() method of thread class ?
What do u mean by variable?
What is difference between path and classpath?
What is a concrete classes? Is Java object class is concrete class?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
Explain about wait() method?
What is difference between wait and notify in java?
What is the difference between array list and vector in java?
What is the file extension for java?
Difference between static synchronization vs. Instance synchronization?
What are the access modifiers available in java?
Does string isempty check for null?
What is passing value java?
What is the maximum size of array in java?
How to display all the prime numbers between 1 and 100