3
is of primitive type int
and JVM first widens it to float
instead of wrapping it into Integer
Widening in Java method overloading comes into picture when an
overloaded method does not find its exact matching signature. In that
case, when an exact match isn't found, the JVM uses the method with
the smallest argument that is wider than the parameter.
Widening beats boxing because autoboxing feature was added to Java in
J2SE 5.0 release. So, Java 5's designers decided that pre-existing
code should not break and it should function the way it used to. Since
widening capability already existed; therefore, an overloaded method
gives preference to widening over boxing.
http://cs-fundamentals.com/java-programming/method-overloading-in-java.php