Write a Java method that takes an integer array as a formal parameter and returns the sum of integers contained within the array.

What will be an ideal response?

```
public int sumArray(int[] a)
{
int sum = 0;
for(int i =0; i < a.length; i++)
sum += a[i];
return sum;
}

```

Computer Science & Information Technology

You might also like to view...

A(n) ________ is a self-contained instruction that can be combined with other instructions to automate tasks and is considered to be the basic building block of macros

Fill in the blank(s) with correct word

Computer Science & Information Technology

On Facebook, what information you do or don't share depends on how private you want to be

Indicate whether the statement is true or false

Computer Science & Information Technology