摘要: 将ArrayList中的元素按照给定字符拼接起来 public static void main(String[] args) { List<String> list = Arrays.asList("nice","to","meet","you"); System.out.println(list 阅读全文
posted @ 2020-05-06 23:58 行云至他方 阅读(412) 评论(0) 推荐(0) 编辑
摘要: Collectors.toList()用来结束Stream流。 public static void main(String[] args) { List<String> list = Arrays.asList("hello","world","stream"); list.stream().ma 阅读全文
posted @ 2020-05-06 21:28 行云至他方 阅读(24485) 评论(0) 推荐(2) 编辑
摘要: Stream流的创建方法 public static void main(String[] args) { Stream stream1 = Stream.of("hello","world","hello stream"); String[] myArray = new String[]{"hel 阅读全文
posted @ 2020-05-06 18:56 行云至他方 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 方法引用实际上是Lambda表达式的一种语法糖 方法引用分为4类: 1.类名::静态方法名 public class Student { private String name; private int mark; public Student(String name, int mark) { th 阅读全文
posted @ 2020-05-06 16:04 行云至他方 阅读(187) 评论(0) 推荐(0) 编辑