using equals method overriding which objects are
compared?i.e same class objects or other class
objects?Explain me.
Answers were Sorted based on User's Feedback
Answer / kisu
if u r not sure then dont give that wrong answer..bcoz we r
suffering..and we won't chose which one is correct..so plz
plz give those answer which one is perfect ....
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
What is the purpose of final keyword and when to use it?
What is variable and example?
Explain about object oriented programming and its features?
Which class represents the socket that both the client and server use to communicate with each other?
Are arrays classes in java?
What is a string what operation can be performed out with the help of a string?
What is an 8 bit word?
Can we access instance variables within static methods ?
What is memory leak and how does java handle it?
What's the purpose of static methods and static variables?
What does += mean in java?
What is percentage in java?