posted 17 years ago
This code generates output: 12
Explanation:
x==y => true, because it's the value of the primitive that is compareda==b => true, the reference to the Integer object is compared, but because the Integer value is in byte range, they refer to the same objecta==c => false, the object references are compared, and c refers to different object because of declaration despite being in byte ranged==e => false, the object references are compared and are different because out of byte range