What is the result?

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?

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:



Leave a Reply 3

Your email address will not be published. Required fields are marked *


KashiHide

KashiHide

C.

If line n1 looks like below, A is the correct answer.
BiFunction val = (t1, t2) -> t1 + t2; //line n1

smh

smh

C.
A compilation error occurs at line n1.