Inner Classes
Nested ClassesThe Java programming language allows you to define a class within another class. Such a class is called a nested classThere are two catagoriesstatic and non-static.Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes.
Points about nested classesA nested class is a member of its enclosing class. Non-static nested classes (inner classes) have access to other members of the enclosing class, even if they are declared private.Static nested classes do not have access to other members of the enclosing class. 
Local and Anonymous Inner ClassesThere are two additional types of inner classes. You can declare an inner class within the body of a method. Such a class is known as a local inner class. You can also declare an inner class within the body of a method without naming it. These classes are known as anonymous inner classes.
End

Inner classes

  • 1.
  • 2.
    Nested ClassesThe Javaprogramming language allows you to define a class within another class. Such a class is called a nested classThere are two catagoriesstatic and non-static.Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes.
  • 3.
    Points about nestedclassesA nested class is a member of its enclosing class. Non-static nested classes (inner classes) have access to other members of the enclosing class, even if they are declared private.Static nested classes do not have access to other members of the enclosing class. 
  • 4.
    Local and AnonymousInner ClassesThere are two additional types of inner classes. You can declare an inner class within the body of a method. Such a class is known as a local inner class. You can also declare an inner class within the body of a method without naming it. These classes are known as anonymous inner classes.
  • 5.