could someone solve this with a good explanation for me please??
but i am confused with 3rd one.. how is the answer "can be true" possible if a.equals(b) is true.. shouldn't it be always true?
Shrinath M Aithal wrote:thanks Mr. Henry, ya.. you are right.. I am feeling like crucifying myself now... how do i delete this thread from here please.?
shouldn't .equals() be returning true, as in if I tried comparing two Integer or String objects?
Shrinath M Aithal wrote:you mean to say "it is useless to type equals, rather use ==" because they both do same job ?
so how many other classes out there are really like this? I mean, if StringBuffer doesn't know how to check deeply enough, then how many other classes are doing the same way?
if asked in exam, how can i be sure, it does deep compare or not?
.. but i am confused with 3rd one.. how is the answer "can be true" possible if a.equals(b) is true.. shouldn't it be always true?
given that... a.equals(b) then, a == b ________________