Java8-Stream-No.09

mac2022-06-30  115

import java.util.Arrays; public class Streams9 { public static void main(String[] args) { Arrays.asList("a1", "a2", "b1", "c2", "c1") .stream() .filter(s -> s.startsWith("c")) .map(String::toUpperCase) .sorted() .forEach(System.out::println); // C1 // C2 } }

转载于:https://www.cnblogs.com/bilaisheng/p/10210929.html

最新回复(0)