题目内容

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

The JVM stores the array in an area of memory, called _______, which is used for dynamic memory allocation where blocks of memory are allocated and freed in an arbitrary order.

A. dynamic memory
B. stack
C. heap
D. memory block

答案查题题库