where as i was expecting objects are same can anyone explain me as to why it is generating this output?
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
posted 9 years ago
since equals method is not overidden in MyClass , it uses the Object's equals version which returns true on if the objects are referring to the same object. Since in your case its creating two different objects , it returns false.