1
class A
{
    {
        class B
        {
        // What is the use of an inner class inside IIB?
        }
    }
}
dkatzel
  • 31,188
  • 3
  • 63
  • 67

1 Answers1

0

We use inner classes to logically group classes and interfaces in one place so that it can be more readable and maintainable.

Additionally, it can access all the members of outer class including private data members and methods.

A member class is also defined as a member of a class. Unlike the static variety, the member class is instance specific and has access to any and all methods and members, even the parent's this reference.

more info here and here

Ankur Singhal
  • 26,012
  • 16
  • 82
  • 116