The name length is a method in an array.
查看答案
In the following code, what is the printout for list2? class Test {public static void main(String[] args) {int[] list1 = {3, 2, 1};int[] list2 = {1, 2, 3};list2 = list1;list1[0] = 0; list1[1] = 1; list2[2] = 2; for (int i = list2.length - 1; i >= 0; i--)System.out.print(list2[i] + " ");} }
A. 0 1 2
B. 1 2 3
C. 2 1 0
D. 0 1 3.
Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?
A. int count = args.length - 1;
B. int count=0; while (!(args[count].equals(""))) count ++;
C. int count = 0; while (args[count] != null) count ++;
D. int count = args.length;
x.length does not exist if x is null.
A. false
B. true
The array index of the first element in an array is 0.
A. true
B. false