Unable to print in Bluej console using PrintWriter
问题 Consider the following code- import java.io.*; public class test { public static void main(String[] args) { PrintWriter out= new PrintWriter(System.out); out.println(1); out.close(); } } I run it on bluej for the first time and get output 1 on console. On running it again i get no output at all and same is the case for any subsequent tries. Would love to know why this is happening. 回答1: Ok, the problem why this method only works once is, that the PrintWriter.close() method also closes the