/* This shows how arrays are declared, and how memory is used */ public class arraydec { public static void main(String[] args) { // this only declares an array, there is no space reserved in memory int[] series1; // this declares the array, and also fills it with data int[] series2 = {1,2,4,8,16}; // this allocates space for the array, but it will be empty int[] series3 = new int[5]; // we can copy the data into the allocated, but empty series3 for(int i=0; i<5 ; i++) { series3[i] = series2[i]; } // What will be in series1 after this? series1 = series3; // What will this print out now? System.out.println(series1.length); } }