This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
sum1 is an Integer type object, and that's why it's allowing method calls. But sum2 is not any reference of any class, it's primitive type data. As you can't call any method on primitive type, this is the reason java introduces the concepts of these wrapper classes, for e.g. Integer,Double.