tengo algunos códigos como éste:Cómo usar flush() para PrintStream
PrintWriter pw = new PrintWriter(new BufferedReader(....));
for(int i=0; i<10; i++) {
pw.println("a");
pw.flush();// flush each time when println()?
}
pw.close();
es la flush() en cada uno 'de' declaración necesariamente? Escuché que flush() invocaría automáticamente al invocar close(). Si escribo código como este:
PrintWriter pw = new PrintWriter(new BufferedReader(....), true);
y yo no escribiría pw.flush() más? Gracias.
Otro título de pregunta que tiene muy poco que ver con la pregunta, aunque tiene casi 5,000 vistas –