Wendy Gibbons wrote:is autoboxing just auto casting? in which case why does it have such a confusing name?
No, it works very differently from casting.
Casting is nothing more than giving the compiler a hint that a certain value should be treated as a different type. You can for example have a List (without generics - so it's a List containing Objects). If you know that there are
String objects in the list, you can get an element and cast it to String:
Note that the cast does not do any kind of conversion; it's nothing more than telling the compiler "Look, you don't know this, but this List actually contains Strings, so I want you to treat the result of calling get(0) as a String".
In autoboxing, primitive values are actually converted to instances of wrapper classes (or the other way around for unboxing).