out
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user. 
err
Typically this stream corresponds to display output or another output destination specified by the host environment or user. By convention, this output stream is used to display error messages or other information that should come to the immediate attention of a user even if the principal output stream, the value of the variable out, has been redirected to a file or other destination that is typically not continuously monitored. 

解决方案 »

  1.   

    System.err.println能保证你在连System.out.println都因为异常而无法实现的时候实现屏幕打印功能,怎么可能没区别? adminxp(浪子) 贴出的文档说的很清楚了。
      

  2.   

    System.out.println 能重定向到别的输出流,这样的话你在屏幕上将看不到打印的东西了,
    而System.err.println只能在屏幕上实现打印,即使你重定向了也一样。
      

  3.   

    当向控制台输出信息时,开发者有两个选择:System.out和System.err。使用者更倾向于输出的是System.out,而如果是System.err则输出“error”。尽管这看起来是显而易见的,但很多开发者都不了解为什么出错和调试时使用System.err。 
    当输出一个流时,JVM和操作系统共同决定何时输出这个流。也就是说,尽管开发者键入了:
    System.out.print_
    ("Test Output:");
    JVM和操作系统的组合体并不会立即输出这个流。相反,它将保持等待状态直到将要输出的东西达到一定的量。
    假设输入以下指令:
    System.out.println("Debugging Info.");
    JVM可能同意输出;然而,操作系统可能决定暂不输出。
    由于这个原因,在调试程序时想要发现出错的位置就有可能成为问题。考虑以下的程序:for(int i=0; i<56; i++) {
    System.out.println(i);
    ... // containing an error
    }
    错误可能出现在i等于54时,但是可能JVM在i等于49时就结束输出了。50到54仍然存在于缓存中,结果也就丢失了。使用System.err来报告错误、调试程序就可以避免这种情况出现,它将使每一次操作的结果都输出出来。例如以下程序:for(int i=0; i<56; i++) {
    System.err.println(i);
    ... // containing an error
    }
    在每一次i等于54时都将显示错误信息。
      

  4.   

    System.out.println可能会被缓冲,而System.err.println不会
      

  5.   

    用jbuilder写System.err也发觉了比Sytem.out快些输出
      

  6.   

    System.err.println()是要缓冲的,所以优先级会高点,而System.out.println()是不需要缓冲的,所以优先级会低点.
      

  7.   

    打印System.err在eclipse是红色的.
    System.out是蓝色的.
      

  8.   

    System.out.println可能会被缓冲,而System.err.println不会
    谢谢
    以前也碰到这样的问题
    System.out.println()打印不出来东东
    现在知道了:-)
      

  9.   

    System.err.println()
    调试的时候用
      

  10.   

    我觉得上面说的什么缓存是错误的,这个根本不是两者的区别!在目前的程序中,存在标准输出和错误输出两种的方式,在默认的情况下面两者是指向了同一个输出(即屏幕上的输出),但是这个是可以改变的!
    java -cp classpath MyClass >out.txt 2>err.txt这样运行以后,System.out.println就输出到了out.txt中,System.err.println就输出到err.txt中这才是两者的区别!所以你应该尽量保证你的意思是正确的,即out是一般性的输出,err是当出现错误的时候才使用的输出