What is the Difference Between a Nested Class and an Inner Class in Java ?

An Inner class in Java is non-static class. It is a type of Nested class that is defined in another class but not qualified with a Static modifier. A Nested class is also a class can be Static Nested class or a non-Static Inner class.

An Inner class has access to other members of the enclosing class, even if they are declared private. A Static Nested class can not access the other members of the enclosing class.



You May Interest

What are the Different Types of Classloaders in Java ?

What is the Difference Between pass by reference and pass by valu ...

What is the Difference Between a Class and an Object in Java ?

What is the Use of Run Time Polymorphism in Java ?

What are the Differences Between a HashSet and a HashMap in Java ...