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 ways can an argument be passed to a subroutine and explain them?
How many return statement are allowed in a function?
How to find the given number is a prime number or not by getting input from the user
What is class and object in java?
What is a super method?
What is the difference between equals() and == in java?
Convert a BST into a DLL and DLL to BST in place.
What is stringjoiner ?
Is .net better than java?
What is an interoperable application in java ?
What is null data type?
What are the Class Libraries ?
Explain the protected field modifier?
What is the full form of jpeg?
What are new features introduced with java 8 ?