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

Quiz: Nested and Anonymous Classes · Question 7 of 10

Which of these CANNOT be implemented with a lambda?

Which of these CANNOT be implemented with a lambda?

  1. A.Runnable
  2. B.Comparator<String>
  3. C.An interface with two abstract methods
  4. D.java.util.function.Predicate<Integer>
Answer & explanation

Correct answer: An interface with two abstract methods

A lambda can only implement a functional interface: exactly one abstract method.

Can you get the rest right without peeking?

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

Start the quiz →