// When quantities of privitive types are passed as parameters, Java // makes a copy of their value. // In this example, x in main is different from x in strange // Run in jGRASP using the debugger to see what happens public class ValueSemantics { public static void main(String[] args) { int x = 23; strange(x); System.out.println("2. x = " + x); } public static void strange(int x) { x = x + 1; System.out.println("1. x = " + x); } }