- What is the output of the following code?
public class MysteryBox {
public void method(int a, double b) {
System.out.print(1);
}
public void method(double a, int b) {
System.out.print(2);
}
public static void main(String[] args) {
MysteryBox box = new MysteryBox();
box.method(1.0, 2);
box.method(1, 2.0);
}
}