Given the code fragment:
BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2; //line n1
System.out.println(val.apply(10, 10.5));
What is the result?
A.
20
B.
20.5
C.
A compilation error occurs at line n1.
D.
A compilation error occurs at line n2.
Explanation:
ExplanationExplanation/Reference:
C.
If line n1 looks like below, A is the correct answer.
BiFunction val = (t1, t2) -> t1 + t2; //line n1
C.
A compilation error occurs at line n1.
C