Java Functional Interface MCQs with answers
19 questions tagged Java Functional Interface, each with the correct answer and an explanation.
- Which functional interface is preferred for computations that may fail with an exception?
- In which Java version were functional interfaces introduced?
- Which functional interface method returns void?
- Which interface is marked as functional even though it has `default` methods?
- What is the main benefit of using functional interfaces in Java?
- Which functional interface accepts two arguments and returns a result?
- Which functional interface is used to chain multiple transformations?
- What is the output type of `Function<String, Integer>` when applied to a String?
- Which functional interface returns a value and may throw an exception?
- Which of these is NOT a standard functional interface in Java?
- Which functional interface method is defined in `Predicate`?
- What does the `Function` functional interface do?
- Which functional interface is used when no input is taken but a result is returned?
- Which method does `Consumer` functional interface define?
- What is the purpose of the `Predicate` functional interface?
- Which method is declared by the functional interface `Supplier`?
- Which of the following is a functional interface?
- Which annotation is used to indicate a functional interface?
- What is a functional interface in Java?