import java.util.function.UnaryOperator; public class Main { static UnaryOperator<Integer> factorial = null; public static void main(String[] args) { factorial = i -> i == 0 ? 1 : i * factorial.apply(i - 1); System.out.println(factorial.apply(6)); } }