This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Originally posted by saikrishna cinux: what is the actual difference bwtween system.out.println and system.err.println()
The first writes to "standard output". The second writes to "standard error". These two streams are setup by the operating system when the Java program is executed... And can be redirected with the uses of "|", ">", etc. on the command line.
If the Java program is just ran without any redirection (and the java program don't redirect them), there should be no difference.
[cinux]: No boss i nerver see such thing happen in my system. it is displaying correctly the order is correct
The fact that it displays correctly on your system is no guarantee for other systems. On many systems, standard output and standard error will use different buffers, and these buffers may be flushed at different times. On my own system just now I got: