class Practice {
public static void aMethod (int val) { System.out.println("int"); }
public static void aMethod (short val) { System.out.println("short"); }
public static void aMethod (Object val) { System.out.println("object"); }
public static void aMethod (String val) { System.out.println("String"); }
byte b = 9;
Practice.aMethod(b); // first call My guess:don't know? it is short but why
Practice.aMethod(9); // second call My guess:int correct
Integer i = 9;
Practice.aMethod(i); // third call My guess: Object correct
Practice.aMethod("9"); // fourth call My guess: String correct
}
Why does the method called with byte (b) as a parameter calls the method with short?