← All topics
Quiz: Lambdas and Functional Interfaces: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. Which interface fits a lambda that takes nothing and returns a value?
- Q3. Which interface is the best fit for (a, b) - a + b on two Integers giving an Integer?
- Q4. What does this print? (code)
- Q5. Which method reference is the same as s - s.trim()?
- Q6. Which is a valid lambda for Function<Integer, Integer?
- Q7. Does an interface with one abstract method and three default methods count as functional?
- Q8. What does this print? (code)
- Q9. Why must local variables used inside a lambda be effectively final?
- Q10. Which interface avoids boxing for a function from int to int?