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.
nimo frey wrote:Should I compare wrapper classes (Integer, Long, Short) via equals or via '==' ?
== only works for values between -128 and 127 (inclusive) for Byte, Short, Integer and Long, and for values between 0 and 127 for Character. And only if the object was retrieved using the static valueOf(primitive) method. Otherwise, a new object is created and == will return false.