This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori 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.