Which line(s) immediately flush the output buffer?
1. System.out.print("One for the money");
2. System.out.print("Two for the show\n");
3. System.out.println("Three to get ready");
4. System.out.print("And four to go");
5. System.out.flush();
a. line 5 only
b. lines 3 and 5
c. lines 2, 3 and 5
d. every line

Respuesta :

Answer:

lines 2,3 and 5 ( c )

Explanation:

The lines that immediately flush the output buffer are :  System.out.print("Two for the show\n"); .   System.out.println("Three to get ready"); and   System.out.flush();

making use of the new line character or printIn() statement the buffered output gets flushed therefore making autoflush true

but System.out.print() doesn't  use any flush technique so we need to flush the buffered output done by the print() statement hence we choose lines 2,3,5