Question: You are given the class Person.java. Using DataOutputStream and following the example given in Chapter 17 Example TestDataStream.java , write a Java program that creates

You are given the class Person.java. Using DataOutputStream and following the example given in Chapter 17 Example TestDataStream.java , write a Java program that creates three instances of the class Person and writes their attributes to a file named people.dat. This means you must create three objects of type Person with different attribute information. Write a second program (or continue on with the first after closing the written file) that reads from people.data using DataInputStream, recreates the Person Objects and prints them to the console using System.out.println and the Person.toString method Part II; Repeat the above using ObjectOutputStream and ObjectInputStream.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!