Your browser has JavaScript turned off. This page is best viewed with Javascript enabled. Certain functions on this site will not work, and some style sheets will not load. Check your browser preferences to enable JavaScript.
1. Individual Arrays can hold One type of variable Two types of variables Infinite types of variables None of the above
2. T/F: To get to the fifth element in an array, you have to go through the first four. True False
3. T/F: In Java, Arrays can be expanded and contracted whenever you want. True False
4. The following code will make which array?
String[] tracks; tracks = new String[4]; tracks[1] = "here"; tracks[3] = "there"; (null indicates that there is no element in that index)
5. In a array nums of ints with the following values: 2, 4, 1, 0, 6, 7, what does the following statements change the array to be?
nums[1] = nums[5] + 6; nums[0]++; nums[5] = nums[1] – 6;
6. What does the following loop change the array “grades” to be if grades starts out as 81, 67, 98, 93, 94, 83?
for (int k = 0; k < 6; k++) { if (grades[k] < 90) { grades[k] += 5; } else { grades[k] += 2; } }