Autoboxing

suggest change

Versions

Java SE 5 through Java SE 9 (Early Access).

Introduction

Autoboxing is the automatic conversion the Java compiler makes between primitive types and their wrapper classes. For example, int becomes Integer and double becomes Double. The conversion the other way is called unboxing. Collections store references, not primitives, so a primitive is boxed when you put it in a collection.

Remarks

Autoboxing can have performance issues when used frequently in your code.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents