Create a java application reads from a text file


Discuss the below:

Create 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.

 

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create a java application reads from a text file
Reference No:- TGS01934942

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)