Why does the nullprintstream() function in Java / Lang / system compare currenttimemillis() to zero?
•
Java
When loading the system class, the < clinit > method instantiates the in, out and err printstream variables with the nullprintstream() method, and the printstream variables are null:
private static PrintStream nullPrintStream() throws NullPointerException { if (currentTimeMillis() > 0) { return null; } throw new NullPointerException(); }
Solution
The Javadoc of the nullprintstream() method provides a clue:
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码