标签:[] each .com div package array highlight demo system
package com.ant.jdk8.com.ant.jdk8.chap01; import java.util.Arrays; import java.util.Comparator; import java.util.List; public class AppleWeightSortDemo { public static void main(String[] args) { List<Apple> apples = Arrays.asList(new Apple("green",2), new Apple("green",1),new Apple("red",3)); apples.sort(Comparator.comparing(Apple::getWeight)); apples.stream().forEach(apple-> System.out.println(apple.getWeight())); } }
标签:[] each .com div package array highlight demo system
原文地址:https://www.cnblogs.com/i-hard-working/p/9574700.html