Given the code fragment:



What is the result?

A. 4000.0
B. 4000
C. A compilation error occurs at line n1.
D. A compilation error occurs at line n2.

題解

程式第10行會編譯錯誤,原因在於List的泛型型態為Double,而UnaryOperator卻是使用Integer,兩者不同所以編譯錯誤。