Question: Modify the TelephoneNumber class described in Exercise 6 so that it is serializable. Write a program that creates an array whose base type is TelephoneNumber

Modify the TelephoneNumber class described in Exercise 6 so that it is serializable. Write a program that creates an array whose base type is TelephoneNumber by reading data from the keyboard. Write the array to a binary file using the method writeObject. Then read the data from the file using the method readObject and display the information to the screen. Allow the user to change, add, or delete any telephone number until he or she indicates that all changes are complete. Then write the modified telephone numbers to the file, replacing its original contents.

Step by Step Solution

3.31 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class SerializedTelephoneNumber implements Serializable private boolean hasAreaCode private int areaCode private int exchangeCode private int number Creates a new instance of SerializedTelephon... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java An Introduction to Problem Solving and Progra Questions!