What is the meaning of SuperClass s=new SubClass();?
<p>Test.java</p>

<pre><code>public class Test {

    public void go(){       
        System.out.println("Test go");
    }
}
</code></pre>

<p>Test2.java</p>

<pre><code>public class Test2 extends Test {
public void go(){       
    System.out.println("Test 2 go");
}

public void back(){
    System.out.println("Test 2 back");
    }   
}

class Demo{

    public static void main(String[] args) {

    Test t=new Test2();
    t.go(); // Output : "Test 2 go"
    t.back(); //Compile time error. 
 }

 }
</code></pre>

<p>I read some issues on stackoverflow regarding this but I did not understood the meaning of <code>SuperClass s=new SubClass();</code>.
Also in output if Object of Test can access the <code>go()</code> method of Test2 then why it cannot access <code>back()</code> method.</p>