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 |
Can bool be null?
Mention some features of java?
can you use the two main method in same class?how?
4 Answers DELL, Geosoft, SparkTG,
Is boolean a data type in java?
What is a nested list?
What is character in data type?
I want to persist data of objects for later use. What is the best approach to do so?
what is main purpose of interface?
2 Answers Accenture, HCL, NIIT,
What is string :: npos?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
how to java plateform independent?
Which One is optimal to choose ? Syncronized hash map or Hash table with single thread model? How can a hash map syncronized with out using syncrozed blocks in programm?