Is inner class important in Java?

Inner classes are a security mechanism in Java . We know a class cannot be associated with the access modifier private, but if we have the class as a member of other class, then the inner class can be made private. And this is also used to access the private members of a class.8 Oca 2018

Read more

Why are Java inner classes bad?

Now you are clear that inner classes keep reference to outer class .So image scenario where you pass reference of inner class to other outer world class and then reference never gets released to in turn OuterClass is also referenced , hence leak. So this makes using inner classes bad if not used prpperly.

Read more