/** * The code below highlights issues when passing object references * as inputs to methods: The methods can make permanent changes to * the objects at the end of the references! This can't happen when * passing primitive types. */ public class PassingParameters { /** * This method changes its input value, and proves that * it's been changed by printing out the new value. * @param n The input value */ public void addOne(int n) { n = n + 1; System.out.println("After adding 1, n is "+n); } /** * This method calls addOne, above, but prints before and * after the call so we can see any changes addOne makes. */ public void test() { int x = 100; System.out.println("Before: "+x); addOne(x); System.out.println("After: "+x); } /** * Method that takes an array of ints as its input, and increments * each of them. It does NOT have a return value... */ public void incrementAll(int[] nums) { for(int i=0; i