Which of the following is true about the anonymous inner class?
A. It has only methods
B. Objects can’t be created
C. It has a fixed class name
D. It has no class name
Answer:D
Which of the following is true about the anonymous inner class?
A. It has only methods B. Objects can’t be created C. It has a fixed class name D. It has no class name
Explanation: Anonymous inner classes are the same as the local classes except that they don’t have any name. The main use of it is to override methods of classes or interfaces. And the rest three options are false about the anonymous inner classes as it can have both methods and objects. It does not have any fixed came name.