Originally posted by Awais Sheikh:
System.out.println is used to print a string. and err.println is also used to print string. whats the difference? why should we use err.println to print a error message while we can do same with System.out.println. isn't it?? Please comment
For standard Output
Standard output The standard output device is that part of the operating system that controls where a program sends its output. By default, the standard output device sends the output to a device driver attached to the screen. However, the output destination can be redirected to a device driver attached to a file or printer, which results in the same program displaying its findings on the screen, saving them in a file, or providing a hardcopy listing of the results.
For Standard Error The standard error device is that part of the operating system that controls where a program sends error messages. Unlike the standard output device, you cannot redirect standard error on platforms such as Windows 98 SE.
I hope it clears you.