Here println method returning the output as true instead of false. I wanna know why is that so, 'cause as far as I'm concerned both primitive values will implicitly convert into wrapper classes, Double and Integer for comparison, and two wrapper classes cannot be considered equal. Thanks in advance for help. [ October 28, 2008: Message edited by: Pawan Arora ]
as far as I'm concerned both primitive values will implicitly convert into wrapper classes
That's when you assign a primitive to a wrapper of that type (say int to Integer reference) with JDK 5 onwards, called boxing (or auto boxing). And the reverse also possible (unboxing) when you assign wrapper type reference to premitive reference.
Here "==" operator checks the content(value) of what the references refers to. In this case both equal (value 42).
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus