Q:

invoking method via reference variable

I'm trying to understand how System.out can invoke println(). All the searches  say System.out is an instance of PrintStream class therefore it can invoke a method in that class.
BUT...
When I try to duplicate this with the following a NullPointerException results.
public class Main {
    public static void main(String[] args){
        Tasker.calc.add(1, 2);
    }
}

class Tasker{
    static Calc calc;
}

class Calc {
    public void add(int x, int y){
        System.out.println(x+y);
    }
}

Isn't Tasker.calc a similar instance of Calc?
How is System.out not a NullPointerException?
To be clear, this is not a question about NullPointerException... this is a question about why System.out doesn't require initialization.
Thanks a bunch!

A:

Why doesn't System.out require initialisation?  Well ...
Deep inside the System class, there's a method called initializeSystemClass which the JVM calls. It sets System.out to the right value, so you don't have to.
Note that System.out is NOT an instance of PrintStream - it's a REFERENCE to an instance of PrintStream.

