The way in which unboxed argument lists are currently handled can lead to processing inefficiencies. This is especially true when we use Object[] or List<object> as variable-length argument lists. Java uses java.lang.invoke to transform the method calls using boxing. In Java, autoboxing is when the compiler automatically converts primitive types and their corresponding object wrapper classes. Here is the list of wrapper classes along with the corresponding primitive type:
Wrapper class | Primitive type |
Boolean | boolean |
Byte | byte |
Character | char |
Double | double |
Float | float |
Integer | int |
Long | long |
Short | short |
As you can see from the following illustration autoboxing occurs when we go ...