🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: static, final and Nested Classes: all 10 questions

Quiz: static, final and Nested Classes · Question 9 of 10

Which can an anonymous class do that a lambda cannot?

Which can an anonymous class do that a lambda cannot?

  1. A.Use an effectively final local variable
  2. B.Implement an interface that has two abstract methods
  3. C.Return a value
  4. D.Be passed to a method
Answer & explanation

Correct answer: Implement an interface that has two abstract methods

A lambda can only implement a functional interface (one abstract method). An anonymous class can implement any interface or extend a class.

Can you get the rest right without peeking?

Take the timed Quiz: static, final and Nested Classes quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →