Thursday, September 24, 2015

Java 8 method reference

Integer::valueOf or System.out::println

what does it mean? Basically they are the reference to a method.

Function f = Integer::valueOf;
Consumer println = System.out::println;

Lambda is also a function
Function f = (str) -> {
    return str.hashCode();
};

No comments:

Post a Comment