Java OCA OCP Practice Question 1647

Question

Which of the following is not a functional interface in the java.util.function package?

A.   BiPredicate
B.   DoubleUnaryOperator
C.   ObjectDoubleConsumer
D.   ToLongFunction


C.

Note

The BiPredicate interface takes two generic arguments and returns a boolean value.

Next, DoubleUnaryOperator takes a double argument and returns a double value.

Last, ToLongFunction takes a generic argument and returns a long value.

That leaves Option C, which is the correct answer.

While there is an ObjDoubleConsumer functional interface,

which takes a generic argument and a double value and does not return any data,

there is no such thing as ObjectDoubleConsumer.

Remember that Object is abbreviated to Obj in all functional interfaces in java.util.function.




PreviousNext

Related