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

Quiz: Lambdas and Functional Interfaces · Question 2 of 10

Which interface fits a lambda that takes nothing and returns a value?

Which interface fits a lambda that takes nothing and returns a value?

  1. A.Consumer<T>
  2. B.Function<T, R>
  3. C.Supplier<T>
  4. D.Predicate<T>
Answer & explanation

Correct answer: Supplier<T>

Supplier.get() takes no arguments and returns a T.

Can you get the rest right without peeking?

Take the timed Quiz: Lambdas and Functional Interfaces quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →