Purchase Solution

Question about Java - working with files

Not what you're looking for?

Ask Custom Question

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.

Purchase this Solution

Solution Summary

The solution explores working with files in Java.

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.