Boxing is intended to map to-and-from primitive types but String is not a primitive. Consider this. If an int were passed to a method
that accepts only a String, boxing does not convert the int to a String.
I will convert it to an Integer type, however.
Jim Hoglund wrote:I will convert it to an Integer type, however.
Auto-boxing and auto-unboxing only occurs if it is necessary. If you pass an int and there is no method that takes an int,or an Integer (or broader like long, Number) the compiler will just refuse to compile the class.