//使用Stream of 建立流
Stream.of(1,2,3,43,5,65).forEach(x-> System.out.println(x));dom
Stream.of(1).forEach(x-> System.out.println(x));it
//使用Arrays.stream
int num[] = {1,2,3,4,5,65,76};
Arrays.stream(num).forEach(x-> System.out.println(x));stream
//使用Stream.iterate
Stream.iterate(1,x->x+1).limit(10).forEach(x-> System.out.println(x));sed
//使用Stream.generate
Stream.generate(Math::random).limit(10).forEach(x-> System.out.println(x));List
//從集合建立
List<String> list = Arrays.asList("12","er","rt","22");
list.stream().forEach(x-> System.out.println(x));
//使用IntStream等的 range和rangeClose
IntStream.range(5,10).forEach(x-> System.out.println(x));
IntStream.rangeClosed(5,10).forEach(x-> System.out.println(x));im