Important Java Mcq 1

Which of the following has a method named flush?

a. Output stream

b. Input stream

c. Reader stream

d. Input reader stream

Answer:

a. Output stream

Explanation:

flush() of output stream class is used to flush the content of the buffer to the Output stream. For example, when we write data to a stream, it is not written immediately, it is buffered. So use flush() when you need to be sure that all your data from the buffer is written.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?