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!