Back to Code Walkthrough
Recursion With Multiplication
Java code walkthrough · Question 34Code
Read carefully. What does this print?1public class Main {23 static int mystery(int n) {4 if (n == 1) {5 return 2;6 }7 return 2 * mystery(n - 1);8 }910 public static void main(String[] args) {11 System.out.println(mystery(4));12 }13}