Key Concepts

Review core concepts you need to learn to master this subject

Autoboxing Primitive Types

// These are all examples of autoboxing Double wrapper1 = 23.456; Integer wrapper2 = 3; Double wrapper3 = new Double(13.57); Integer wrapper4 = new Integer(7); Double wrapper5 = Double.valueOf(30.59); Integer wrapper6 = Integer.valueOf(15);

Autoboxing is the automatic conversion that the Java compiler makes between primitive types and their corresponding object wrapper classes. This includes converting an int to an Integer and a double to a Double.