public class ParamTest {
public static void printSum(int a, Integer b){
System.out.println("In int Integer "+(a+b));
}
public static void printSum(Integer a, Integer b){
System.out.println("In Integer Integer "+(a+b));
}
public static void printSum(Integer a, int b){
System.out.println("In Integer int "+(a+b));
}
public static void main(String[] args) {
printSum(1, 2);
}
}
When called with printSum(Integer.valueOf(1), 2) it works and prints In Integer in. But when this code runs, the JVM cant figure out what method to choose. Is that just the online compiler I'm using (https://www.programiz.com/java-programm ... -compiler/)?