int []allGrades = keyboard.nextLine( ); System.out.println ("You entered the grades for " + allGrades.length + " students.") int [] allGrades = new int;
not sure what you're trying to do here, but it looks to me this 'll blow up in your face.
you're declaring an array with an identical name twice, which is bound to give you some errors, but also you're instantiating it wrong.
keyboard.nextLine() will return a String object, not an array of integers, and new int .. well, it's not a correct declaration for an array.
I think what you're looking for, is more like this:
...
System.out.println("How many grades do you want to enter?");
int num = Integer.parseInt(keyboard.nextLine());
int[] allGrades = new int[num];
// here you read the value and transfer it to an int, and pass this number on
// while creating the array. this number will
// tell the compiler the size of the array you're declaring
for ( int a = 0; a < num; a++ ){
System.out.println("Enter the grade for student " + (a+1));
allGrades[a] = Integer.parseInt(keyboard.nextLine());
}
..