Thread: wrapper classes
View Single Post
  #2 (permalink)  
Old 12-11-2007, 01:08 AM
dmacvittie dmacvittie is offline
Member
 
Join Date: Aug 2007
Posts: 30
dmacvittie is on a distinguished road
int is a "low-level" or "base" data type. There is no class associated with it, it is just a space in the computers' memory (in the case of Java in the JVM's memory).
Integer has all of the class information you would expect - you can inherit from Integer, etc.
For me, I only use Integer where I need a class (for storage in lists, etc)... There is a small amount (really, very small) of overhead using Integer, so if I don't have a good reason to, I don't.

Hope that helps.
Don.
__________________
Don MacVittie F5 Networks -
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote