Specifications
Sun Services
Java™ Programming Language
Module 6, slide 42 of 43
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Wrapper Classes
An example of a wrapper class is:
int pInt = 420;
Integer wInt = new Integer(pInt); // this is called boxing
int p2 = wInt.intValue(); // this is called unboxing
Other methods are:
int x = Integer.valueOf(str).intValue();
int x = Integer.parseInt(str);










