I have just downloaded the source code of jdk and I was interested in the function System.out.println
By looking to the class System in java.lang I go this part:
public final class System {
public final static PrintStream out = null;
and in java.io the class PrintStream is like this declared:
public class PrintStream extends FilterOutputStream
implements Appendable, Closeable {
public void println() {
so if we call the function in the main function System.out.println()
how can this happen if the out object is null. Why there is no java.lang.NullPointerException. Moreover, the class PrintStream is not static to prevent the instantiation of the object.
I am really a beginner in java so please enlight me with the parts I am missing here
Thanks,