+ 2
Why line 2 not printed?
Why only line 1 printer to the output screen(System.out)? The auto flush feature flushes the buffer every time I write to it right? Or am I right? https://code.sololearn.com/cw311m7I8nRM/?ref=app
3 Respostas
+ 2
Rishi,
Haven't been playing with this `PrintWriter` yet. But having read this
https://docs.oracle.com/javase/7/docs/api/java/io/PrintWriter.html
I'm getting an impression that write() method rather stores its argument into the internal buffer rather than sending it to the destination (System.out in your code) the way println() do.
I get an output if I add either one of these after line 8
pw.println(); // <- no argument
pw.flush();
+ 2
do flush() after