What is the difference between System.out.println()
and System.err.println()
in Java?
this answer most probably help you it is so much easy
System.err
and System.out
both are the same both are defined in System
class as reference variable of PrintStream
class as
public final static PrintStream out = null;
and
public final static PrintStream err = null;
means both are ref. variable of PrintStream
class.
normally System.err
is used for printing an error messages, which increase the redability for the programmer.
A minor difference comes in both when we are working with Redirection operator.