Autoboxing & Unboxing

Estimated time to read: 1 minute

Java 5 introduced autoboxing and unboxing, where the compiler lets us write code almost exclusively using primitives, and takes care of creating moving primitives into and out of objects where necessary.

For more details, see:

Java Tutorial: Autoboxing and Unboxing

Java Documentation: Autoboxing

Remember: only Java primitives ultimately contain data in Java. Objects act as containers for those primitives. So write your code using primitives.