← Back to Question List
Java Code Walkthrough #34
Recursion With Multiplication
📄 Code
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}