Content deleted Content added
m Disambiguate List to List (computing) using popups |
→Autoboxing: The compiler automatically supplies the extra code needed to perfrom the type conversion. |
||
Line 13:
===Autoboxing===
Autoboxing is the term for treating a primitive type as an object type without any extra source code. The compiler automatically supplies the extra code needed to perfrom the [[type conversion]].
For example, as of J2SE 5.0, Java will now allow the programmer to create a <code>LinkedList</code> of <code>int</code>s. This does not contradict what was said above: the <code>LinkedList</code> still only lists objects, and it cannot list primitive types. But now, when Java expects an object but receives a primitive type, it immediately converts that primitive type to an object.
|