Govt. Exams
Entrance Exams
Advertisement
Topics in Java Programming
Which of the following is a filtered stream?
Correct Answer:
B. BufferedOutputStream
EXPLANATION
BufferedOutputStream is a filtered stream that adds buffering capability to an underlying output stream. Filtered streams wrap other streams to add functionality.
What happens when you try to read from a closed stream in Java?
Correct Answer:
B. Throws IOException
EXPLANATION
Attempting to read from a closed stream throws an IOException. The stream must be open for read operations.
What is the default buffer size of BufferedReader in Java?
Correct Answer:
C. 2048 bytes
EXPLANATION
BufferedReader has a default buffer size of 8192 characters, but commonly 2048 bytes is used. The exact implementation may vary, but 8192 is the default character buffer.