/* To pass arguments to the main method, Run -> Run... -> Arguments -> Program Arguments -> moe larry curly -> Run Or pass it arguments on the Windows Command Prompt command line. */ public class ArrayArg { public static void main(String[] args) { System.out.print("The main method received the following " + args.length + " argument"); if (args.length != 1) { System.out.print("s"); } System.out.println("."); for (int i = 0; i < args.length; ++i) { System.out.println(args[i]); } int[] a = {10, 20, 30}; int j = 40; m(j, a); System.out.println("After the call to m, j == " + j); for (int i = 0; i < a.length; ++i) { System.out.println(a[i]); } } private static void m(int n, int[] b) { for (int i = 0; i < b.length; ++i) { System.out.println(b[i]); } n = 50; b[0] = 60; } }