Professional Documents
Culture Documents
Pre-Assessment Questions
1. What is the maximum priority that can be assigned to a thread?
a. 5
b. 6
c. 9
d. 10
Solutions to Pre-Assessment
Questions
1. d. 10
2. b. 1
3. a. 1
4. c. run()
5. d. Boolean
Objectives
In this lesson, you will learn about:
Demonstration-Implementing Random
Access Files
• Problem Statement
Demonstration- Implementing
Random Access Files
• Solution
• Don Allen designs the home page for the application using
Swings and applets. The details entered by the students are
stored in a log file using the RandomAccessFile class. To
solve the given problem, perform the following steps:
1. Code the application.
2. Compile and execute the application.
• Solution
• Code the application.
• Compile and execute the application.
Summary
• In this lesson, you learned:
• Using the File class to access properties of a file or a directory.
• Creating a random file for reading or writing the data using the
RandomAccessFile class.
• Using streams in Java for reading and writing data using byte streams
and character streams.
• Using various InputStream classes, such as FileInputStream,
BufferedInputStream, and DataInputStream for reading byte-oriented
data from various input sources.
• Using various OutputStream classes, such as FileOutputStream,
BufferedOutputStream, and DataOutputStream for writing byte-oriented
data to various output destinations.