Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void loadBookFromFile(String filename) throws FileNotFoundException {
- Scanner inFile = new Scanner(new FileReader(filename));
- String firstName, lastName, fullName;
- int month, day, year;
- String street, city, state;
- String zip;
- String phone, status;
- while (inFile.hasNext() == true)// *1
- {
- firstName = inFile.next();
- lastName = inFile.next();
- month = inFile.nextInt(); // System.out.println("Month: " + month);
- day = inFile.nextInt(); // //System.out.println("Day: " + day);
- year = inFile.nextInt();
- inFile.nextLine();
- street = inFile.nextLine(); // System.out.println("street: " +
- // street);
- city = inFile.nextLine(); // System.out.println("city: " + city);
- state = inFile.nextLine(); // System.out.println("state: " + state);
- zip = inFile.nextLine(); // System.out.println("zip: " + zip);
- phone = inFile.nextLine(); // System.out.println("Phone: " + phone);
- status = inFile.nextLine(); // System.out.println("Status: " +
- // status);
- ExtPerson newPerson = new ExtPerson(firstName, lastName, month,
- day, year, street, city, state, zip, phone, status);
- addressList.insertLast(newPerson);
- }
- inFile.close();
- }
Add Comment
Please, Sign In to add comment