What are wrapper classes in Java?

Wrapper Classes are a Java feature that allows you to transform primitive data types to reference or object types and vice versa. In Java, there is a wrapper class for each primitive data type that wraps the primitive types into an object of that particular class. Autoboxing is the process of turning primitive data types into objects, while unpacking is the process of changing an object back to raw data types.

Changing the value within methods is one of the most common uses of wrapper classes. Changes made inside a method will not affect the original value since Java does not support calls by reference. As a result, the original values will change when the types are converted to objects. Additionally, by turning objects into streams, the wrapper classes aid serialization.