0 votes
in JAVA by
What is the difference between a predicate and a function in Java 8?

a) A predicate takes an input and returns a Boolean, while a function takes an input and returns a value.

b) A predicate takes no input and returns a value, while a function takes an input and returns a value.

c) A predicate takes an input and returns no value, while a function takes no input and returns a value.

d) A predicate takes no input and returns no value, while a function takes an input and returns a value.

1 Answer

0 votes
by

Answer: a) A predicate takes an input and returns a Boolean, while a function takes an input and returns a value.

Explanation: A predicate is a type of function that returns a Boolean value, indicating whether a condition is true or false.

...