Usage of function type congruent lambda expressions in Java 8

前端 未结 2 2027
既然无缘
既然无缘 2021-02-07 22:21

I struggle with the definition and usage of the

Stream.collect(Supplier supplier, BiConsumer accumulator, BiConsumer comb         


        
2条回答
  •  情深已故
    2021-02-07 23:02

    ArrayList::add actually has 2 parameters. The ArrayList object on which you call the add method and the parameter to add.

    ArrayList::add is equivalent to (list, element) -> list.add(element) and so it works as a BiConsumer

提交回复
热议问题