Question 1
Consider the following Java program. When the call stack reaches its maximum depth, which method will be at the top of the call stack?
class Example { public void methodA(int x) { if (x > 0) { methodB(x - 1); } } public void methodB(int y) { if (y > 0) { methodC(y - 1); } } public void methodC(int z) { if (z > 0) { methodA(z - 1); } }}
class TestCallStack { public static void main(String[] args) { Example e = new Example(); e.methodA(3); }}