📅  最后修改于: 2022-03-11 14:52:06.154000             🧑  作者: Mango
// import java.util.Arrays;
// import java.util.stream.Stream;
String[] array = {"a", "b", "c", "d", "e"};
//Arrays.stream
Stream stream1 = Arrays.stream(array);
stream1.forEach(x -> System.out.println(x));
//Stream.of
Stream stream2 = Stream.of(array);
stream2.forEach(x -> System.out.println(x));