Question: Which functional interface, when entered into the following blank, allows the class to compile? A. Consumer. B. Consumer C. DoubleConsumer D. Supplier E. None of
Which functional interface, when entered into the following blank, allows the class to compile?

A. Consumer.
B. Consumer
C. DoubleConsumer
D. Supplier
E. None of the above.
} package groceries; import java.util.*; import java.util. function. *; public class Market { private static void checkPrices (List prices, scanner) { prices.forEach (scanner); } public static void main (String[] right) { List prices = List.of (1.2, 6.5, 3.0); checkPrices (prices, } p -> { String result = p
Step by Step Solution
3.31 Rating (151 Votes )
There are 3 Steps involved in it
Given the code snippet we can examine each option to deduce which functional interface will allow the class to compile correctly when used as the type ... View full answer
Get step-by-step solutions from verified subject matter experts
