简单流

写一个SimpleStream

  1. Of方法 : 私有化一个集合,
    然后利用of(list)来创建一个SimpleStream,
    (构造方法私有化,不让外界去创建其对象)
    注意这个方法是静态的, 因为直接类名.of调用

image1

  1. filter方法
    image2

  2. map方法
    image3

4.foreach方法
image4

5.reduce
image5

6.收集方法