Definition of Inner class: A class defined in another class is known as an inner class. Inner classes are categorized into four types. 1. Member inner classes 2. Static  inner classes 3. Local inner classes 4. Anonymous inner classes Member inner classes: If we define a class in another class just as a member like variable and functions of those…