Opentopia Directory Encyclopedia Tools

Primitive wrapper class

Encyclopedia : P : PR : PRI : Primitive wrapper class


In the Java programming language, a primitive wrapper class is one of eight classes provided in the 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 is required. The wrapper classes are used extensively with classes in the package and with the classes in the reflection package.

The primitive wrapper classes and their corresponding primitive types are:

Primitive type Wrapper class
byte
short
int
long
float
double
char
boolean

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

Void

Although it is not a wrapper class, the class is similar in that it provides an object representation of the void return type. The Void class is an uninstantiable placeholder class used by the java.lang.reflect API to hold a reference to the object representing the Java keyword void.

See also

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: