8.) The term ____________________ arrays describes two related arrays of the sam
ID: 3556098 • Letter: 8
Question
8.) The term ____________________ arrays describes two related arrays of the same length, which should be avoided by using an array of objects.
A. simulating
B. parallel
C. synchronized
D. perpendicular
9.) What is the purpose of this algorithm?
for (int i = 0; i < names.length; i++)
{
if (i > 0)
{
System.out.print(", ");
}
System.out.print(names[i]);
}
A. Prints out the names in an array separated by commas.
B. Prints out the names in an array list separated by commas.
C. Appends a comma to the end of each name in an array and prints it.
D. Appends a comma to the end of each name in an array list and prints it.
14.) What is the output of the following code fragment, assuming that the array dataValues has been initialized to contain the sequence: 2, 4, 6, 8, 10?
for (int d: dataValues)
{
d = d * 2;
}
System.out.println("The first value is: " + dataValues[0]);
A. 8
B. bounds error
C. 2
D. 4
16.) Which method replaces an element at a specified position in an array list?
A. get
B. add
C. replace
D. set
19.) What is the type of a variable that references an array of integers?
A. int[]
B. integer()
C. integer[]
D. int()
Explanation / Answer
8 parallel (B)
9 Appends a comma to the end of each name in an array and prints it. (C)
14 4 (D)
16 set (D)
19 int[] (A)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.