Nested classes in Java

Java allows to define a class inside another class. When a class is nested inside a another class, it is said as nested class.


When nested classes can be used ?


General Syntax

class Outer_class{

class Inner_class{

//statements

}

}


Types of nested classes