Choose the correct option based on this program:.
import java.util.function.Function; public class Main { public static void main(String []args) { Function<Integer, Integer> negate = (i -> -i), square = (i -> i * i), negateSquare = negate.compose(square); System.out .println(negateSquare.apply(10)); }//from w w w . j av a2 s . c o m }
B.
the negate.compose(square) calls square before calling negate.
hence, for the given value 10, square results in 100, and when negated, it becomes -100.