Primitive Wrapper Class

A primitive wrapper class in the Java and ActionScript programming languages is one of eight classes provided in the java.lang package to provide object methods for the eight primitive types. All of the primitive wrapper classes in Java are immutable. J2SE 5.0 introduced autoboxing of primitive types into their wrapper object, and automatic unboxing of the wrapper objects into their primitive value—the implicit conversion between the wrapper objects and primitive values.

Wrapper classes are used to represent primitive values when an Object is required. The wrapper classes are used extensively with Collection classes in the java.util package and with the classes in the java.lang.reflect reflection package.

The primitive wrapper classes and their corresponding primitive types are:

Primitive type Wrapper class Constructor Arguments
byte Byte byte or String
short Short short or String
int Integer int or String
long Long long or String
float Float float, double or String
double Double double or String
char Character char
boolean Boolean boolean or String

The Byte, Short, Integer, Long, Float, and Double wrapper classes are all subclasses of the Number class.

The wrapper classes BigDecimal and BigInteger are not one of the primitive wrapper classes and are mutable.

Read more about Primitive Wrapper Class:  Void, Atomic Wrapper Classes

Other articles related to "primitive wrapper class, wrapper, primitive, wrapper class":

Primitive Wrapper Class - Atomic Wrapper Classes
... With Java 5.0, additional wrapper classes were introduced in the java.util.concurrent.atomic package ... classes are mutable and cannot be used as a replacement for the regular wrapper classes ... The atomic wrapper classes and their corresponding types are Primitive type Wrapper class int AtomicInteger long AtomicLong boolean AtomicBoolean V AtomicReference The AtomicInteger and AtomicLong ...

Famous quotes containing the words class and/or primitive:

    We must not discriminate between things. Where things are concerned there are no class distinctions. We must pick out what is good for us where we can find it.
    Pablo Picasso (1881–1973)

    We have as yet had no adequate account of a primitive pine forest.
    Henry David Thoreau (1817–1862)