It’s not possible to create an object of the inner class unless you already have an object of the outer class. This is because the object of the inner class is quietly connected to the object of the outer class that it was made from. However, if you make a
nested class (a
static inner class), then it doesn’t need a reference to the outer-class object.
No comments:
Post a Comment