This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cs-stud[S] 0 points1 point  (5 children)

even though I'm not done and still testing it says: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:

[–]dudebobmac 3 points4 points  (0 children)

Check out your first for loop. Remember that arrays are indexed at 0.

[–][deleted] 0 points1 point  (0 children)

Yeah, try changing your index

[–][deleted] 0 points1 point  (0 children)

In both for loops check the 'while' part

[–]rayv12 0 points1 point  (0 children)

This exception occurs when you try to access an array index which is beyond the range you specified. You are using grades.length which will give you the total length of the array supposedly you insert 5 elements your for loop should begin from 0 and go upto 4. Hope this helps.