Given the following code:
public class Clazz {
private static String foo(Integer value) {
return "Integer";
}
private static String foo(float value) {
return "float";
}
public static void main(String[] args) {
System.out.println(foo(10));
System.out.println(foo(10f));
}
}
Why does it print this?
float
float
I would expect the following output:
Integer
float