Modify the code in Chapter 15’s
StudentListclass in Figure so that objects from that class can be written to a file. For this exercise, you may simply ignore the “dangerous method call” in the
removeStudentmethod. Using the
WriteObjectclass in Figure as a guide, encode a
StudentListFileWriterclass that writes three
StudentListobjects to a file called
StudentLists,as follows: Construct the first object with the same four names as those used in the
StudentListDriverin Figure, and write it to the file. Construct the second object with those same four names plus the additional name “Anna,” and write it to the file. For the third object, use the remove method to remove “Izumi” from the second object, and write this modification of the second object to the file so that it appears as a distinct third object in the file. Finally, using the
ReadObjectclass in Figure as a guide, encode a
StudentListFileReaderclass that reads and displays all objects in the file. Run this
StudentListFileReaderto confirm that the file holds three objects with different name lists.
Figure First draft of StudentList class, which maintains a list of students

Figure WriteObject program, which writes Serializable objects to a file

Figure Driver of StudentList class

Figure ReadObject class that reads all Serializable objects from a file

We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.