Given the following method: public void mystery(int n) { if(n == 0) System.out.p
ID: 3608646 • Letter: G
Question
Given the following method: public void mystery(int n) { if(n == 0) System.out.print("*"); else { mystery(n - 1); System.out.print("+"); mystery(n - 1); } } What is returned by the method call: a)mystery(0)________ b)mystery(1)________ c)mystery(2)________ Given the following method: public void mystery(int n) { if(n == 0) System.out.print("*"); else { mystery(n - 1); System.out.print("+"); mystery(n - 1); } } What is returned by the method call: a)mystery(0)________ b)mystery(1)________ c)mystery(2)________Explanation / Answer
output will be a) * mystery(0)=* b) *+* mystery(1) =mystery(0)+mystery(0) =*+* c) *+*+*+* mystery(2) =mystery(1)+mystery(1) =*+*+*+*