the only time recursion occurs is if x != y
so ...
Consider the following code.
public void printNumbers(int x, int y) {
if (x < 5) {
System.out.println("x: " + x);
}
if (y > 5) { System.out.println("y: " + y);
}
int a = (int)(Math.random() * 10);
int b= (int)(Math.random() * 10);
if (x != y) printNumbers(a, b);
}
Which of the following conditions will cause recursion to stop with certainty?
x < 5
x < 5 or y > 5
x != y
x == y
1 answer