SHARE
TWEET

Untitled

advictoriam Jan 16th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ArrayOps
  2. {
  3.    /**
  4.       This method adds up the integer values in an array,
  5.       with the integer sum returned at the end of the method.
  6.       @param values, an array of integers, may be positive or negative
  7.       @ return, the sum of the integers
  8.    */
  9.    public static int sumArray(int values[])
  10.    {
  11.       int count = 0;
  12.       for(int a : values)
  13.       {
  14.          count+=a;
  15.          
  16.       }
  17.       return count;
  18.    }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top