This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
If I am not wrong ..You have crated 4 Integer objects, when you compare object references using == then the values inside reference (which is something how to get object values from heap) is checked while when you use equals() method which is inherited by every class in Java you compare the values pointed by the reference variables.
So its not necessary that always your first condition evaluates to true.
but your second condition will always evaluate to true,(Till values are same.) cause equals() is overridden in Integer class. [ August 09, 2007: Message edited by: prateek chaudhari ]
Prateek<br />SCJP 1.5
Joined: Jun 10, 2005
thanks a lot !
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com