Question 1
What is the purpose of the Java I/O (Input/Output) system?
To handle network communication
To handle file and console input and output
To manage database connections
To manage memory and CPU usage
Question 2
Which of the following classes is used to read data from a file in Java?
Writer
Reader
OutputStream
FileInputStream
Question 3
What does the Writer class in Java primarily handle?
Reading binary data from a file
Writing text data to a file
Writing binary data to a file
Reading text data from a file
Question 4
Which of the following classes is a direct subclass of InputStream in Java?
Reader
FileReader
BufferedReader
FileInputStream
Question 5
What is the primary function of the read() method in the Reader class?
To read text data one character at a time
To read text data line by line
To read binary data
To convert data into a byte array
Question 6
Which of the following is true about Writer and Reader classes in Java I/O?
Writer handles character streams, while Reader handles byte streams
Writer and Reader are used for handling character streams
Writer handles byte streams, while Reader handles character streams
Both handle binary data
Question 7
Which of the following is a subclass of Writer in Java?
FileReader
OutputStreamWriter
BufferedReader
FileInputStream
Question 8
Which method of the Reader class is used to read a single character?
readByte()
readChar()
read()
readLine()
Question 9
Which of the following I/O streams does not require closing after use?
Reader and Writer
FileInputStream and FileOutputStream
BufferedReader and BufferedWriter
None of the above
Question 10
What does the close() method do in the context of Java I/O streams?
Releases any system resources used by the stream
Reads data from the stream
Writes data to the stream
None of the above
There are 10 questions to complete.