import java.util.*;
public class MyClass {
MyClass()
{
}
public static void main(String args[]) {
Node n = new Node();// CT error - non-static variable this cannot be referenced from a static context
MyClass obj = new MyClass();//works (Why? Since this is also a non-static)
test t = new test();//works (Why? Since this is also a non-static)
}
class Node{
};
}
class test{
}
How can main method (which is static) call it's own class' constructor even if it is non-static? And can't call nested class' constructor.