Which of the following is true about the anonymous inner class?
1. Objects can’t be created
2. It has a fixed class name
3. It has only methods
4. It has no class name
Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Answer: option 4). It has no class name
Explanation: The only difference between anonymous inner classes and local classes is that they don’t have a name. Its primary purpose is to override class or interface methods. The other three alternatives about anonymous inner classes are false because they can have both methods and objects. It doesn’t have a specific name.
Hence the option 4) It has no class name is correct answer.