12


10/06/09 - Arrays
Arrays provide a way to store multiple values under a single variable name.
A given array can only store one type of variable.
To create an array named myIntArray of one hundred ints:
     int [] myIntArray = new int[100];
To create an array called names of 10 Strings:
     String [] names = new String[10];
To create an array called values of 25 doubles:
     double [] values = new double[25];
Every array has a length variable that identifies how many values it can store.
The following program fills an int array with the squares of integers and prints them to the screen.
The following program asks the user for the number of test scores to enter, creates arrays for the names of the students and the values of the test scores, then prints the names and corresponding test scores and the max, min and average of the test scores.
Homework