1)
What's the contents of array vals after the following
code is executed?
int[] vals = {6, 1, 4, 5, 1};
int size = vals.length;
for(int i = 0; i < size; i++)
vals[i] = vals[i] * i;
q) [ 6, 1, 4, 5, 1 ]
b)[ 0, 1, 2, 3, 4]
c)[0, 1, 8, 15, 4]
d)[6, 2, 12, 20, 5]
2)
Consider function foo defined below:
static int[] foo(int vals[]) {
int result[] = new int[vals.length - 1];...