public class Week09Notes01A { public static void main(String[] args) { // declare an array of ints int[] ai; // make an array of length read from user int l = (int) IO.readDouble("Your length > "); ai = new int[l]; // walk array and make each element hold for (int i = 0; i < ai.length; i++) { // its index ai[i] = i; } ai[3] = 55; // causes ArrayIndexOutOfBoundsException if the // value read for the length read from the user is < 3 } }