get sum of array and return string

Solutions on MaxInterview for get sum of array and return string by the best coders in the world

showing results for - "get sum of array and return string"
Emilio
04 Jun 2018
1public static String getSumOfArrayAndReturnStringValue(String[] array) {
2    double sum = 0;
3    for (String value : array) {
4    sum += Double.parseDouble(value);
5  }
6  return String.valueOf(sum);
7}