Inner member classes are those classes declared within the body of another class without the static modifier. Inner member classes need an instance of their enclosing class in order to be instantiated. For instance,
"Inner member static class" are called top-level nested class and are also declared within the body of another class but with the static modifier. Top-level nested class do not need an instance of their enclosing class to be instantiated. For instance,
Hi Paolo. An inner member class, that is, a non-static inner class "belongs" to an instance of the enclosing class and only has scope as long as that instance exists. This inner class has access to all members (non-static and static) of the enclosing class, even if its declared private. However, it can only declare non-static members for itself. On the other hand, a static member class, that is, a top level nested class, doesn't need an instance of the enclosing class, can only access static members of the enclosing class, but can declare both static and non-static members for itself.
I promise I will be the best, most loyal friend ever! All for this tiny ad: