Exception in thread "main" java.lang.Error: Unresolved compilation problem:
No enclosing instance of type MainClass is accessible. Must qualify the allocation with an enclosing instance of type MainClass (e.g. x.new A() where x is an instance of MainClass).
at MainClass.main(MainClass.java:6)