public class Test {
public static void main(String[] args) {
for (int i = 0; i < 2; ++i) {
System.out.println("normal");
System.err.println("error");
}
}
}
在IDE下有时运行结果是:
normal
normal
error
error
在命令提示符下运行结果是:
normal
error
normal
error
求大侠解答
后者是正确的。不知道你用的是什么ide,应该是ide的bug。因为不同的环境对于err out的定向机制不同。