What is the wrapper class for the primitive type int in Java?

The story behind the answer

The wrapper class for the primitive type int in Java is Integer. It is a final class in the java.lang package that represents an integer value as an object rather than as a primitive value.

Wrapper classes exist because many Java APIs work with objects. For example, generic collections such as ArrayList<Integer> store Integer objects, not raw int values. Java 5 introduced autoboxing and unboxing, allowing the compiler to convert automatically between int and Integer in many contexts: an int can become an Integer, and an Integer can be extracted back to an int.

Integer is more than a container. It provides useful constants and methods, including MIN_VALUE, MAX_VALUE, parseInt, compare, and toString. Integer objects are immutable, meaning their represented value cannot be changed after creation.

A frequent mistake is choosing Number. Number is an abstract superclass for numeric wrappers such as Integer, Long, Float, and Double; it is not the specific wrapper for int. Int is also not Java’s wrapper-class name, and IntWrapper is not a standard Java class.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: