Wiki Markup |
---|
A Boxing conversion converts the values of a primitive type to the corresponding values of the reference type, for instance, from {{int}} to the type {{Integer}} \[[JLS 5.1.7 Boxing Conversion|http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7]\]. It can be convenient in many cases where an object parameter is desired, such as with collection classes like {{Map}} and {{List}}. Another use case is to pass object references to methods, sinceas compared to primitive types that always operate using pass by value. The resulting wrapper types also help reduce clutter in code. |
...