Use the class ClassObjectIODemo shown in Listing 10.10 of Chapter 10 to create a file of Species

Question:

Use the class ClassObjectIODemo shown in Listing 10.10 of Chapter 10 to create a file of Species objects. The class Species is given in Chapter 10, Listing 10.9. Then write a program that reads the Species objects from the file you created into an instance of ArrayList, sorts these instances alphabetically by Species name, and then writes the sorted data to both the screen and a file. Read all file names from the user.


Listing 10.10

import java.io.FileInputStream; import java.io.FileOutputStream; i mport java.io.10Exception; i mport java.io.0bjectInputStream; import java.io.0bjectOutputStream; public class ClassobjectIODemo { public static void main(String []args) { ObjectoutputStream outputStream = null; String fileName =


Listing 10.9

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: