0 votes
in JAVA by (30.8k points)
What are the advantages of Java inner classes?

1 Answer

0 votes
by (30.8k points)

There are two types of advantages of Java inner classes.

Nested classes represent a special type of relationship that is it can access all the members (data members and methods) of the outer class including private.

Nested classes are used to develop a more readable and maintainable code because it logically groups classes and interfaces in one place only.

Code Optimization: It requires less code to write.

Related questions