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
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
Get step-by-step solutions from verified subject matter experts
