Question: Which method reference can replace the lambda on the second line so the output is the same? A. s::contains(a) B. s::contains C. String::contains(a) D. String::contains
Which method reference can replace the lambda on the second line so the output is the same?

A. s::contains(a)
B. s::contains
C. String::contains(a)
D. String::contains
E. The supplied code does not compile.
F. None of the above.
var s = "fish"; Predicate pred System.out.println(pred.test("is")); = (a) > s. contains (a);
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
The lambda expression provided here is a scontainsa which is a lambda expression that matches the Pr... View full answer
Get step-by-step solutions from verified subject matter experts
