Explanation: A functional interface has exactly one abstract method, enabling it to be used with lambda expressions.
Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: A functional interface has exactly one abstract method, enabling it to be used with lambda expressions.
Explanation: `@FunctionalInterface` is used to enforce that an interface has exactly one abstract method.
Explanation: `Runnable` is a functional interface with a single `run()` method.
Explanation: `Supplier` provides the `get()` method to return a value.
Explanation: `Predicate` takes an input and returns a boolean result based on a condition.
Explanation: `Consumer` defines `accept()` which consumes a single input with no return.
Explanation: `Supplier` provides a result with no input.
Explanation: `Function` transforms input of type T to output of type R.
Explanation: `Predicate` defines the `test()` method that returns a boolean.
Explanation: `Cloneable` is a marker interface and not a functional interface.