Consumer with more than one argument in Java 8?

For 3 and more arguments you could use curried( functions with last consumer:

Function<Double, Function<Integer, Consumer<String>>> f = d -> i -> s -> {
            System.out.println("" + d+ ";" + i+ ";" + s); 

Output is:


It’s enough to have a function of one argument to express function of any number of arguments:

Leave a Comment