Java tutorial
import java.util.function.Function; public class Main { public static void main(String[] argv) { // Using a lambda expression Function<Integer, String> func1 = x -> Integer.toBinaryString(x); System.out.println(func1.apply(10)); // Using a method reference Function<Integer, String> func2 = Integer::toBinaryString; System.out.println(func2.apply(10)); } }