package class9_1_PassingTheBuckAndReadingFiles_StudentRecords_start;// Dr. Yoder. MSOE. 26 April 2017 import java.io.FileNotFoundException; public class StudentDriver { public static void main(String[] args) { String filename = "john.txt"; Student student = null; boolean studentNotFound = false; while(!studentNotFound && student == null) { try { student = new Student(filename); } catch (StudentNotFoundException e) { studentNotFound = true; System.err.println("Registrar: Could not load student file:" + filename); e.printStackTrace(); } catch (FileNotFoundException e) { System.out.println("This happens half the time. Sorry!"); } } // TODO: I noticed a bug in the program after class. // If file not found, we come here. // And get a NullPointerException... System.out.println("student.getName() = " + student.getName()); System.out.println("student.getMajor() = " + student.getMajor()); student.printCourses(); } }