Computer Science, asked by divaa7909, 1 year ago

What is difference between system.Out.Println and system.Err.Println

Answers

Answered by 21paras
1

okay so here's the thing

System.err.println() will print to the standard error. If you are using a simple Java console application, both outputs will be the same (the command line or console) but you can reconfigure the streams so that for example, System.out still prints to the console but System.err writes to a file.

System.out.println is a Java statement that prints the argument passed, into the System.out which is generally stdout.

System is a Class

out is a Variable

println() is a method

System is a class in the java.lang package . The out is a static member of the System class, and is an instance of java.io.PrintStream . The println is a method of java.io.PrintStream. This method is overloaded to print message to output destination, which is typically a console or file.

the System class belongs to java.lang package

Attachments:
Similar questions