/* * Arrays, Methods and Pointers * The class name is an acronym * * The point of this class is to show what happens when you change the contents * of an array passed into a method as opposed to changing * * @author ggtowell * Created: Aug 2023 * Modified: Oct 2023 */ public class AMP { public static void main(String[] args) { int[] array = new int[1]; array[0] = 50; int notArray = 5; System.out.println(array[0] + " " + notArray); methd(array, notArray); System.out.println(array[0] + " " + notArray); } /* * This method receives an array with one integer in it and an integer * This changes the value of both integers. * Then is done. * The point is that the change made to the array gets back to the main method, * the change made of the integer does not. */ public static void methd(int[] marr, int mnarr) { System.out.println(marr[0] + " " + mnarr); marr[0] = 7000; mnarr = 700; System.out.println(marr[0] + " " + mnarr); } }