java8 方法引用与lambda
List<String> list = new ArrayList<>(); //list.stream().filter((String s)->System.out.print(s);return s); String str="sadfasdf"; //str.length() Function<String,Integer> func1= (s1)->s1.length(); Function<String,Integer> func2= String::length; Function<String,Integer> func3= (s1)->str.length(); Supplier<Integer> func4= str::length;