Boxed Number
A boxed number, such as this instance of Integer, is nice
because it can be treated as an object and has useful methods.
However:
- Integer takes twice as much storage as an int.
- Integer is immutable:
since it is possible that multiple variables point to it, we cannot change it.
- Doing arithmetic (even ++) requires creation of a new box
(allocation of new storage), often making the old box garbage.
- Boxes are somewhat expensive because they must be
garbage collected.
Contents   
Page-10   
Prev   
Next   
Page+10   
Index