Back to Code Walkthrough
Method Return and Scope
Java code walkthrough · Question 5Code
Read carefully. What does this print?1public class Main {2 static int mystery(int x) {3 x = x * 2;4 return x + 1;5 }67 public static void main(String[] args) {8 int num = 3;9 int result = mystery(num);10 System.out.println(num + " " + result);11 }12}