nested class in java

Static Nested Classes

Restriction on Static Nested Classes static keyword can be applied on classes and interfaces only when they are nested. Top-level classes and interfaces cannot be static. This is the second variation of the total six discussed in this series. Note: It is advised to read the basics and types of…

Nested Classes Java

JDK 1.1 introduced a new type of classes known as inner classes. All the classes you have done so far are known as top-level classes. A class written inside another class is known as "inner class" or "nested class". That is, an inner class is enclosed within another class. Inner…