Answers for "sum values of map in java"

1

how to sum the values of a hashmap

float sum = 0.0f;
for (float f : map.values()) {
    sum += f;
}
Posted by: Guest on July-22-2020

Browse Popular Code Answers by Language