Explore BrainMass
Share

Question about Java - working with files

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Write a Java application that reads from a text file a set of lines containing the persons data in the format
last_name first_name age

(one person per line, the fields are separated by one or more spaces or tabs). The program should create for each name a serialized object with 3 instance members: first and last names (as Strings) and age (as int), and put those objects in an ArrayList. After this, the program should create on the hard disk a binary file containing the saved objects in the serialized form.

Provide exception handling for opening and reading from the input file. Also, provide exception handling for checking the input file format. Your program must explain to the user the reason for each exception and terminate if one is thrown.

© BrainMass Inc. brainmass.com December 20, 2018, 2:49 am ad1c9bdddf
https://brainmass.com/computer-science/java/question-about-java-working-files-233796

Solution Summary

The solution explores working with files in Java.

$2.19