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.
The moose likes Beginning Java and the fly likes What is the difference ? int / Interger Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the difference ? int / Interger" Watch "What is the difference ? int / Interger" New topic

What is the difference ? int / Interger

podonga poron
Ranch Hand

Joined: May 12, 2008
Posts: 55
what is the difference of declaring a variable "int" or declaring it "Integer" ?

an explanation will be VERY appreciated

thanks !
marc weber

Joined: Aug 31, 2004
Posts: 11343

An int is a primitive type. An int variable stores the actual 32-bit value.

An Integer is a type of object that "wraps" an int value. An Integer variable stores a reference to the Integer instance.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Katrina Owen

Joined: Nov 03, 2006
Posts: 1367
I'd suggest taking a look at story about cups, which explains a lot of this really nicely.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: What is the difference ? int / Interger
jQuery in Action, 3rd edition