An inner class is a class declared inside another class. The enclosing class can be a top level class or another inner class. The reason for using inner classes is to properly implement composition when the life of inner class instances are controlled by the outer class instance. Since the inner class instances are always [...]
Filed under: Java Language by Daniel Pietraru
2 Comments »
A nested interface is just a regular interface defined inside another class or interface. They are actually defined inside the body of the parent class, not only in the same file. The feature is useful for grouping related interfaces and for encapsulating interfaces in the classes where they are used.
Filed under: Java Language by Daniel Pietraru
Comments Off
A static nested class is a regular class defined inside of a package level class or inside of another static nested class. They are actually defined inside the body of the parent class, not only in the same file. As with any high level facility offered by a programming language it can be of real [...]
Filed under: Java Language by Daniel Pietraru
No Comments »