Primitive Data Wrappers - StarShipTutor/StarshipTutorAPCS GitHub Wiki

Primitive Data Wrappers

For each of the eight primitive data types there are predefined wrapper classes that continue static utility methods that can be called at any time or the class objects can be used to wrap a particular primitive verbal in an object so it can be used by other classes and methods that require objects as their parameters.

The Primitive Data Wrappers

Special Purpose Data Types

Integer Data Types

Floating Point Data Types

Autoboxing and Unboxing

In many cases the Java compiler will convert a primitive variable into an object and back again as needed. The process of wrapping a primitive is called boxing and unwrapping is called unboxing. Java's automatic handling of this is called Autoboxing.

Most of the time this happens without the programer needing to notice or worry about it.