Java Array Sum getSum(int[] array)

Here you can find the source of getSum(int[] array)

Description

get Sum

License

Open Source License

Declaration

public static int getSum(int[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {

    public static int getSum(int[] array) {
        int ges = 0;
        for (int value : array)
            ges += value;/*from  w  w w .  ja  va 2  s.  co  m*/
        return ges;
    }

    public static int getSum(List<Integer> list) {
        int ges = 0;
        for (int value : list)
            ges += value;
        return ges;
    }
}

Related

  1. arraySum(double[] a)
  2. arraySum(double[] arr)
  3. arraySum(final double input[])
  4. ArraySum(float[] a)
  5. arraySum(int[] intArray, short flag)
  6. getSum(int[] array)
  7. sum( int[] a)
  8. sum(byte... bytes)
  9. sum(byte[] array)