Array initialization error
===

I am doing java programming practice from a website. I have to display this out put using arrays.

    Enter the number of students: 3
    Enter the grade for student 1: 55
    Enter the grade for student 2: 108
    Invalid grade, try again...
    Enter the grade for student 2: 56
    Enter the grade for student 3: 57
    The average is 56.0

This is my source code so far, it is raising error `The local variable grades may not have been initialized`. How do I recover this? I have to make this program using arrays.

    package array;
    
    import java.util.Scanner;
    
    public class GradesAverage {
    	
    	public static void main(String[] args) {
    		
    		int numStudents = 0;
    		int[] grades;
    		
    		Scanner in = new Scanner(System.in);
    		
    		System.out.print("Enter number of students : ");
    		numStudents = Integer.parseInt(in.next());
    	      
    		  for (int i = 0; i < numStudents; i++) {
    		      System.out.print("Enter grade of student "+i+" :");
    			  grades[i] = Integer.parseInt(in.next());
    		}
    	        
    	}
    
    }


