Wrapper Classes: Integer and Double
In Java, a wrapper class is a class that allows you to convert a primitive data type into an object. For example, the primitive int has a corresponding wrapper class called Integer, and the primitive double has a wrapper class called Double.
Wrapper classes let you treat primitive values like objects. They also have methods for converting between types and accessing metadata, which is useful information describing its properties, such as Integer.MAX_VALUE, which we have learned about in 1.2. Most importantly. they are useful for working with Java collections like ArrayList, which only work with objects. We will learn more about ArrayList in unit 7.