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.
return value is Integer so need to change to IntValue()
then it will compile and result would be 20
BiFunction val = (t1, t2) -> t1.intValue() + t2.intValue(); // line n1
but in that case answer is C
C
C
c
C