onsider the following method that is intended to return the sum of the elements in the array key.
public static int sumArray(int[] key)
{
int sum = 0;
for (int i = 1; i <= key.length; i++)
{
/* missing code */
}
return sum;
}
Which of the following statements should be used to replace /* missing code */ so that sumArray() will work as intended?
a. sum += key[i];
b. sum = key[i];
c. sum += sum + key[i - 1];
d. sum += sum + key[i];
e. sum += key[i - 1];
onsider the following method that is intended to return the sum of the elements in the...