[Solved] Get the sum of elements of an ArrayList


To get the sum of the elements as your question states, you can use streams.

int sum = history.stream()
    .filter(his->his.getRes().equals("Vundet"))
    .mapToInt(his->his.getWins()) // assuming this getter exists.
    .sum();

2

solved Get the sum of elements of an ArrayList