LearnFrenzy
Sign in Take a free test

Lambda Expressions · Lambda Expressions MCQ · Question 13

A difference between lambdas and anonymous classes Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 13 Back to Exercise

Which can an anonymous class do but a lambda cannot?

  • A Capture effectively final variables
  • B Keep its own state in fields and implement an interface with several abstract methods Correct
  • C Implement Runnable
  • D Be passed to a method
Correct Answer: Option B

Anonymous classes can also extend abstract classes.

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