Java MCQs with answers
4,796 java multiple choice questions with the correct answer and a short explanation for each. Last updated 22 Jul 2025. Showing page 1 of 240.
- 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?
- Which method reference would map a collection of strings to their lengths?
About the Java question set
These questions are contributed by users and published after review. Each page shows all four options, the correct answer and an explanation, so you can revise a topic in a few minutes. Start from page one for the newest additions, or open any question and use the topic tags under it to reach related sets.