We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
简化代码编写
Collections.sort(inventory, new Comparator<Apple>() { public int compare(Apple a1, Apple a2) { return a1.getWeight().compareTo(a2.getWeight()); } }
inventory.sort(comparing(Apple::getWeight));
public static List<Apple> filterApples(List<Apple> inventory, String color, Int weight, Bool flag) { List<Apple> result = new ArrayList<>(); for (Apple apple : inventory) { if (flag && apple.getColor().equals(color)) || (!flag && apple.getWeight() > weight)) { result.add(apple); } return result; } List<Apple> greenApples = filterApples(inventory, "green", 0, true);
The text was updated successfully, but these errors were encountered:
thinkerou
No branches or pull requests
基础知识
为什么要关心 Java 8
简化代码编写
通过行为参数化传递代码
Lambda 表达式
函数式数据处理
高效 Java 8 编程
超越 Java 8
The text was updated successfully, but these errors were encountered: