0% found this document useful (0 votes)
2 views1 page

Tutorial Lab 10

The document outlines a lab exercise for Object Oriented Development with Java focused on Object Input/Output. It includes tasks such as creating a binary file, calculating the total of integers in a binary file, storing various data types in a file, and modifying a Loan class to implement Serializable. The exercises aim to enhance practical skills in file handling and serialization in Java.

Uploaded by

dummymail1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Tutorial Lab 10

The document outlines a lab exercise for Object Oriented Development with Java focused on Object Input/Output. It includes tasks such as creating a binary file, calculating the total of integers in a binary file, storing various data types in a file, and modifying a Loan class to implement Serializable. The exercises aim to enhance practical skills in file handling and serialization in Java.

Uploaded by

dummymail1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Object Oriented Development with Java (CT038-3-2) Object IO

Lab 10 –Object Input/Output


Answer the following questions.

Exercise:

1. Write a program to create a file named [Link] if it does not exist. If it exists,
append new data to it. Write one hundred integers created randomly into the file using
binary I/O.

2. Suppose a binary data file created in Q1 ([Link]). Write a program to find the
total of integers.

3. Write a program that stores an array of five int values 1, 2, 3, 4, and 5, a Date
object for current time, and the double value 5.5 into the file named [Link].

4. Given a [Link] class. Rewrite the Loan class to implement Serializable.


Write a program that creates five Loan objects and stores them in a file named
[Link].

Level 2 Asia Pacific University of Technology and Innovation Page 1 of 1

You might also like