Javatpoint Logo
Javatpoint Logo

Java System setErr() Method

The setErr() method of Java System class is used to reassign the "standard" error output stream.

Syntax

Parameter

err - It is the new standard error output stream.

Exception:

SecurityException: This exception will throw if the security manager exists and its checkPermission method doesn't allow reassigning of the standard output stream.

Example 1

Test it Now

Output:

Done!!

Example 2

Test it Now

Output:

java.io.PrintStream@ed17bee

Next TopicJava System




Help Others, Please Share

facebook twitter pinterest