In the following code, what is the printout for list1? public class Test {public static void main(String[] args) {int[] list1 = {1, 2, 3};int[] list2 = {1, 2, 3};list2 = list1;list1[0] = 0; list1[1] = 1; list2[2] = 2; for (int i = 0; i < list1.length; i++)System.out.print(list1[i] + " ");} }
A. 0 1 3
B. 1 1 1
C. 0 1 2
D. 1 2 3
查看答案
What is the representation of the third element in an array called a?
A. a[3]
B. a[2]
C. a(3)
D. a(2)
Use the selectionSort method presented in this section to answer this question. What is list1 after executing the following statements? double[] list1 = {3.1, 3.1, 2.5, 6.4}; selectionSort(list1);
A. list1 is 3.1, 3.1, 2.5, 6.4
B. list1 is 3.1, 2.5, 3.1, 6.4
C. list1 is 2.5 3.1, 3.1, 6.4
D. list1 is 6.4, 3.1, 3.1, 2.5
If you declare an array double[] list = {3.4, 2.0, 3.5, 5.5}, list[1] is ________.
A. 3.5
B. 2.0
C. undefined
D. 3.4
When you return an array from a method, the method returns __________.
A. the reference of the array
B. the length of the array
C. a copy of the array
D. a copy of the first element