What is the difference between a static and a non-static inner class?
Java facilitate to write a class within another class called Nested class. Nested class is of two types static and non-static. Static nested class is a class which is declared using 'static' keyword and the non-static classes are called inner/non-static nested class.
Non-static nested class have full access of all the members inside which it is nested whereas, static nested class can't invoke non-static methods or access non-static fields of an instance of the class within which it is nested.
For more detail please go through the following link