200.
•
•
•
201.
Hello World
Explain the differences between the Supplier and
Consumer interfaces.
Answer:
Both the Supplier and Consumer interfaces are built–in
functional
interfaces in the java.util.function package. There are
several differences between the two as follows:
The Supplier interface does not accept an argument, the
Consumer interface accepts
an argument of any data type
The Supplier interface produces a return value of any data
type, the Consumer interface does not return any value
The Supplier interface basically
produces a value of a
Do'stlaringiz bilan baham: