LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 17

What is an anonymous class? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 17 Back to Exercise

What is an anonymous class?

  • A A class without fields
  • B A class with no name, declared and instantiated in one expression, usually to implement an interface once Correct
  • C A private class
  • D A deprecated class
Correct Answer: Option B

For single-method interfaces a lambda is shorter.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links