What is Predicate in JAVA 8 ? Mphasis Interview Question-2022
Predicate in JAVA 8:
Predicate is a built in functional interface present in java.util.function package. It is specifically used for code management and unit testing. It contains built in functions which is as follows:
test(T t) :-
It evaluates the predicate on the value passed to this function as the argument and then returns a boolean value.
Example:
Comments
Post a Comment