// Helene Martin, CSE 142 // Demonstration of basic array usage import java.util.*; public class ArrayDemo { public static void main(String[] args) { // use the jGRASP debugger to see what these arrays look like int[] values = new int[4]; boolean[] wins = new boolean[67]; String[] names = new String[450]; values[0] = 5; values[1] = 2; values[3] = 6 % 4 + 156; // values[1] is an int so can itself be used as an index values[values[1]] = 15; // array traversal: // loop over each index of the array for (int i = 0; i < values.length; i++) { // do something cool with values[i] System.out.println(values[i]); } } }