Accumulate inside forEach Java 8

前端 未结 0 1304
梦如初夏
梦如初夏 2020-12-19 05:49

How can I accumulate inside a forEach? this is my code:

public Double accumulate() {
        Double accum = 0d;

        numbers.stream().forEach(p-> {

           


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题