Wrapper Classes
Wrapper Classes
Wrapper Classes
byte Byte
short Short
int Integer
long Long
char Character
float Float
double Double
boolean Boolean
int x = 25;
• When x and y are assigned integer values, the compiler boxes the integers
because x and y are integer objects.
• In the println() statement, x and y are unboxed so that they can be added as
integers.
Example:
public static String toString (int a)
Example:
Integer i = Integer.valueOf (“135”);
Double d = Double.valueOf (“13.5”);