Suppose a method p has the following heading: public static int[] p()What return statement may be used in p()?
A. return 1;
B. return int[]{1, 2, 3};
C. return new int[]{1, 2, 3};
D. return {1, 2, 3};
查看答案
The reverse method is defined in the textbook. What is list1 after executing the following statements? int[] list1 = {1, 2, 3, 4, 5, 6}; list1 = reverse(list1);
A. list1 is 6 6 6 6 6 6
B. list1 is 6 5 4 3 2 1
C. list1 is 0 0 0 0 0 0
D. list1 is 1 2 3 4 5 6
The arraycopy method does not allocate memory space for the target array. The target array must already be created with memory space allocateD.
A. true
B. false
Given the following statementint[] list = new int[10];
A. The array variable list contains a memory address that refers to an array of 10 int values.
B. The array variable list contains ten values of type int.
C. The array variable list contains a memory address that refers to an array of 9 int values.
D. The array variable list contains nine values of type int.
When you pass an array to a method, the method receives __________.
A. a copy of the first element
B. a copy of the array
C. the reference of the array
D. the length of the array