DEVFYI - Developer Resource - FYI

What are the different types of inner classes?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

158. What are the different types of inner classes?

There are four different types of inner classes in Java. They are: a)Static member classes , a static member class has access to all static methods of the parent, or top-level, class b) Member classes, the member class is instance specific and has access to any and all methods and members, even the parent's this reference c) Local classes, are declared within a block of code and are visible only within that block, just as any other method variable. d) Anonymous classes, is a local class that has no name

(Continued on next question...)

Other Interview Questions