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 meant by class loader and how many types are there?
What are accessor methods in java?
How do you do math powers in java?
Why are the objects immutable in java?
What is "this" keyword in java? Explain
what is purpose of collections.unmodified() method..?
What are the changes in java.io in java 8 ?
What are the advantages and disadvantages of reference counting in garbage collection?
Difference between final and effectively final ? Why is effectively final even required ?
design an lru cache in java?
What does this () mean in constructor chaining concept?
When is update method called?