Calling Nested Class Constructor from main()
Consider the following code:
publicclass OuterClass{
staticstaticvoid main(String[] args){
NestedClass nc =new NestedClass()
}
class NestedClass{
NestedClass(){
//constructor logic here
}
}
}
This call to the nested class constructor gives the following error: " 'OuterClass.this' cannot be referenced from a static context. However, if I cut and paste the code for NestedClass into its own class file, there are no error messages. I would like to be able to keep the class nested, so what do I need to do?

