Possible Duplicate:
Why do I get “non-static variable this cannot be referenced from a static context”?
Here are the codes
public class Stack
{
private class Node{
...
}
...
public static void main(String[] args){
Node node = new Node(); // generates a compiling error
}
}
the error says:
non-static class Node cannot be referenced from a static context
Why shouldn't I refer the Node class in my main() method ?