File size: 407 Bytes
0284885 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | package Stream_initial_package;
import java.util.stream.Stream;
public class Stream_demo5 {
public static void main(String[] args) {
//一堆零散数据 public static<T> Stream<T> of (T...value) Stream接口中的静态方法
Stream.of(1, 2, 3, 4, 5).forEach(s -> System.out.println(s));
Stream.of("a", "b", "c", "d", "e").forEach(s -> System.out.println(s));
}
}
|