#Reading Writing object in binary file

1 messages · Page 1 of 1 (latest)

sand daggerBOT
#

<@&987246399047479336> please have a look, thanks.

queen chasm
#

Write a Java program that performs the following:
Create a class named Person with fields for name (String) and age (int).
Create a binary file named people.dat and write a list of Person objects (e.g., three different people) to it using ObjectOutputStream.
Read the list of Person objects from people.dat using ObjectInputStream.
Print the details of each Person object to the console.
Handle any potential exceptions properly.

this was the question