6.8.15.An instance of an inner class cannot be created without first creating an instance of its outer class.
class MainClass{ public static void main(String[] args) {
Inner inner = new Inner();
} class Inner {
Inner() {
}
}
}
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).