how to get the sum of all elements of an array list in java code example
Example: sum of list java
double sum = 0;
for(int i = 0; i < m.size(); i++)
sum += m.get(i);
return sum;
double sum = 0;
for(int i = 0; i < m.size(); i++)
sum += m.get(i);
return sum;