if
/else
mysteryConsider the following Java code.
public static void mystery2(int a, int b) { if (a < b) { a = a * 2; } if (a > b) { a = a - 10; } else { b++; } System.out.println(a + " " + b); }
Fill in the boxes with the output produced by each of the method calls.
mystery2(10, 3);
|
0 3 |
|
mystery2(6, 6);
|
6 7 |
|
mystery2(3, 4);
|
-4 4 |
|
mystery2(4, 20);
|
8 21 |