+ 1
Need help
What is returned as a result of calling mystery(1)? public static int mystery (int x) { if (x == 5){ return x; } else { return mystery(x--) * 5; } } 1=StackOverFlowError 2=25 3=nothing 5=5
3 odpowiedzi
+ 2
Run the code and find out!
+ 1
It is a stack overflow as post increment is used, calling mystery(1) over and over, again and again.
+ 1
The correct answer is 1 = StackOverFlowError