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...

In a block letter format, paragraphs begin at the left margin or may be indented 0.5".

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A method that executes because it is called automatically when an appropriate event occurs is an event ____.

A. responder B. listener C. handler D. source

Computer Science & Information Technology

GNOME is an intuitive desktop environment that supports ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The ____________________ version of a website should include only the most essential information to reduce the amount of content displayed on a smartphone.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology