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.
Here Autoboxing works in java 5 in line 4 ,here what actually happen valueOf() returns Wrapper(Long) and unwrap it to premitive (long). in line 7 and 9 both methods retunrns premitive and wrap it to Wrapper. If you use java 4 autoboxing will not work and it will give compiler error.