Java Nested class is defined when a class is present/define within another class. The scope of the nested class is defined within the curly bracket. In java, it is possible to define the class within another class; such classes are known as nested classes.
Nested Class enables you to logically group classes that are only used in one place; thus, it increases the use of encapsulation and creates a more readable and maintainable code.
See the following syntax.
class outer {
// statements of outer class
class inner {
// statements of inner class
}
} // outer close
#java nested class #ava #nested classes