title: reading student record from file
body: <p>I'm trying to read a file that has student record(first name, last name, and grade).
  I have written a simple code to accomplish this task but the code fails after reading two lines from the text file. Here is my code: </p>
  
  <pre><code>public class Student {
  private final  String first,last;
  final int MAXGRADE = 100; 
  final int LOWGRADE = 0; 
  private final int grade;
  
  public Student(String firstname,String lastname, int grade){
      this.first = firstname;
      this.last = lastname;
      this.grade = grade;
  
  }
  @Override
  public String toString(){
      return first + " " + last + "\t" + grade;
  }
  }
  </code></pre>
  
  <p>and the driver has this code </p>
  
  <pre><code>public class driver {
  public static void main(String[] args) throws FileNotFoundException {
     String first_name ,last_name;
      int grade;
      Scanner fileInput = new Scanner(new File("data1.txt"));
      while (fileInput.hasNextLine())
      {
          first_name = fileInput.next();
          last_name = fileInput.next();
          grade = fileInput.nextInt();
  
          Student st = new Student(first_name, last_name,grade);
  
        System.out.println(st);
  
      }
  }
  }
  </code></pre>
  
  <p>the compiler is pointing to this</p>
  
  <pre><code>grade = fileInput.nextInt();
  </code></pre>
  
  <p>as the source of the error. </p>