public class ArrayTest { public static void main(String[] args) { System.out.println("Length of args array: " + args.length); // print out all of the command-line arguments // using for-each System.out.println("Command-line arguments, using for-each:"); for (String str : args) { System.out.println(str); } // print out all of the command-line arguments // using a regular for loop System.out.println("Command-line arguments, using regular for loop:"); for (int i = 0; i < args.length; i++) { System.out.println(args[i]); } // create a new array of integers int[] scores = new int[5]; System.out.println("Length of scores array: " + scores.length); for (int i = 0; i < scores.length; i++) { scores[i] = i * 2; } for (int score : scores) { System.out.println(score); } } }