Hi Friends, The answer for this question is "c",but I am wondering why not "a,c".The two Integer objects i1,i2 are not equal and they might have equal or unequal hashcodes.So(h1 == h2),could return "true" or "false",you never know.Please correct me ..and lemme know where i am going wrong.
Thanks Barry, After going thru your reply,i understood where i was goin wrong.By saying not equal,i meant that i1,i2 are refering to two different objects on the heap,but i knew i1.equals(i2) is true as the contents were the same.And I was thinking that the hashcode is calculated depending upon the reference i.e "==".Actually,that was my stupidity..sorry!!!
SCJP 1.4 (88%)<br />SCWCD 1.4 (88%)
The only cure for that is hours of television radiation. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop