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
how many types of Inheritance?
List some important features of java 10 release?
What is stringreader?
Write a program to print 15 random numbers using foreach of java 8?
How do you convert int to char in java?
How many types of memory areas are allocated by JVM in java?
What does .equals do in java?
Why can we not override static method?
What does || mean in vectors?
Can we have multiple catch block for a try block?
What is ternary operator in java?
What is the syntax and characteristics of a lambda expression? Explain
Explain what are final variable in java?
What are features of java?
explain different ways of using thread? : Java thread