How do inner classes work in Java?

Any non-static nested class is known as inner class in java. Java inner class is associated with the object of the class and they can access all the variables and methods of the outer class . Since inner classes are associated with the instance, we can’t have any static variables in them.

Read more