problem in this lines
int[]totalScores = new int[students.length];
for(int i=0; i< students.length; i++)
{
for(int j=1; j<4; j++)
{
totalScores[i]= totalScores[i]+students[i].getScore(j);
}
}
you allocated students.length size for the totalscore.. but u are using 4*students.length.. so arrayindex out of bounds occured. use this
int[]totalScores = new int[4*students.length];
thanks
arefin