Which lambda can replace the MyPrintable
class to return the same value? (Choose all that apply.)
public interface Printable { String print(double d); } public class MyPrintable implements Printable { public String print(double d) { return "Printing"; } }
A, F.
B is incorrect because it does not use the return keyword.
C, D, and E are incorrect because the variable e is already in use from the lambda and cannot be redefined.
Additionally, C is missing the return keyword and E is missing the semicolon.
A and F are the only correct lambda expressions that match the functional interface.