How to sum the values in List

I want to find the sum of the List<int[]> using Java 8. Here is my attempt. int sum = counts.stream().flatMap(i -> Stream.of(i).mapToInt(m)).sum(); However, I get the error cannot convert ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "How to sum the values in List"