🎙 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 10 of 10

Which interface avoids boxing for a function from int to int?

Which interface avoids boxing for a function from int to int?

  1. A.Function<Integer, Integer>
  2. B.IntUnaryOperator
  3. C.UnaryOperator<Integer>
  4. D.Supplier<Integer>
Answer & explanation

Correct answer: IntUnaryOperator

IntUnaryOperator.applyAsInt works on primitive ints directly.

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 →