java 知识点

1.Lambdas及函数式接口的例子

布尔表达式 (List<String> list) -> list.isEmpty()   Predicate<List<String>> 
创建对象 () -> new Apple(10)   Supplier<Apple> 
消费一个对象 (Apple a) -> System.out.println(a.getWeight())   Consumer<Apple> 
从一个对象中选择/提取(String s) -> s.length()  Function<String, Integer>或ToIntFunction<String> 
合并两个值 (int a, int b) -> a * b IntBinaryOperator 
比较两个对象 (Apple a1, Apple a2) -> a1.getWeight().compareTo(a2.getWeight())  Comparator<Apple>或
                                                                              BiFunction<Apple, Apple, Integer>
                                                                              或 ToIntBiFunction<Apple, Apple> 

2.title

code
posted @ 2022-05-14 16:03  caiusxin  阅读(18)  评论(0)    收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css