import java.util.Scanner;
public class Mid {
    Scanner scan = new Scanner(System.in);
    int student;
    int arr [][]=new int[student][5];
    String str[]= {"science","math","english"};
    
    public void score() {
        System.out.println("how many student?");
        student=scan.nextInt();
        
        for(int i=0;i<student; i++) {
            for(int j=0;j<3;j++) {
                System.out.println("input"+(i+1)+"student "+str[j]+"score");
                arr[i][j]=scan.nextInt();
                }
        }
    }
I am trying to input the number of students and then the grades of the students. It keeps happening out of bounds exception... How can I solve it?
 
    