Error messages in the system, in and in err

I looked at the java.lang.System source code and found the following lines:

public final static InputStream in = null;
public final static PrintStream out = null;
public final static PrintStream err = null;

I know that the final link cannot be reassigned, and therefore method calls such as "System.out.println" should throw a NullPointerException. On the other hand, I saw that System.setOut is implemented in C (well, setOut0) and wondered what is going on here and how I can reassign the value for the final link.

+4
source share

All Articles