Lambda expressions

import java.util.function.*;

//explicitly specify return type
Function<IntegerInteger> powOfTwo = 
    (Integer power) -> (int)Math.pow(2, power);
var pow8 = powOfTwo.apply(8);
//pow8 is 256

//implicitly specify return type
Function<DoubleDouble> powOfThree = 
    power -> Math.pow(3, power);
var pow3 = powOfThree.apply(3.0);
//pow3 is 27.0

System.out.printf("pow8 = %s\n", pow8);
System.out.printf("pow3 = %s", pow3);