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 a static class in java?
Is a class an object?
What will happen to the exception object after exception handling?
What is an array and a vector? How they different from each other?
What are Encapsulation, Polymorphism and Inheritance?
what is multithreading?
Explain the term virtual machine?
What isan abstract class and when do you use it?
Can we create more than one object singleton class?
what are three ways in which a thread can enter the waiting state? : Java thread
What is finally block?
How does arraylist work in java?