logo Practice-It logo

BJP4 Self-Check 7.23: arrayCodeTracing4

Language/Type: Java arrays array mystery
Author: Marty Stepp (on 2016/09/08)

What are the values of the elements in the array numbers after the following code is executed?

int[] numbers = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
for (int i = 1; i < 10; i++) {
    numbers[i] = numbers[i - 1];
}
numbers[0]
numbers[1]
numbers[2]
numbers[3]
numbers[4]
numbers[5]
numbers[6]
numbers[7]
numbers[8]
numbers[9]

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.