← 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?
- A.Function<Integer, Integer>
- B.IntUnaryOperator
- C.UnaryOperator<Integer>
- 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 →