logo Practice-It logo

BJP5 Self-Check 7.6: fillDataArray

Language/Type: Java arrays array mystery
Author: Marty Stepp (on 2019/09/19)

Fill in the array with the values that would be stored after the code executes:

int[] data = new int[8];
data[0] = 3;
data[7] = -18;
data[4] = 5;
data[1] = data[0];

int x = data[4];
data[4] = 6;
data[x] = data[0] * data[1];
data[0]
data[1]
data[2]
data[3]
data[4]
data[5]
data[6]
data[7]

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.