Q54: What are the primary built-in Functional Interfaces in java.util.function?
Predicate<T>:boolean test(T t)— Accepts input, returns boolean.Function<T, R>:R apply(T t)— Accepts input $T$, transforms and returns result $R$.Consumer<T>:void accept(T t)— Accepts input, returns void (side-effects).Supplier<T>:T get()— Accepts no input, produces result $T$.UnaryOperator<T>:T apply(T t)— Function where input and output types match.
Key Takeaways
Predicate: Test condition ($T o ext{boolean}$).Function: Transform data ($T o R$).Consumer: Execute action ($T o ext{void}$).Supplier: Supply value ($emptyset o T$).
Knowledge Check
Which functional interface signature accepts an argument and returns NO output result (void)?