// CSE 142 Lecture 5 // Parameters // 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; System.out.println(x); strange(x); System.out.println(x); } public static void strange(int x) { System.out.println(x); x = x + 1; System.out.println(x); } }