题目内容

Suppose int[] numbers = new int[10], what is numbers[0]?

A. 10.
B. null
C. 0
D. undefineD.

查看答案
更多问题

You can use the operator == to check whether two variables refer to the same array.

A. false
B. true

The arguments passed to the main method is an array of strings. If no argument is passed, args.length is 0.

A. true
B. false

Which correctly creates an array of five empty Strings?

A. String[ ] a = new String [5]; for (int i = 0; i < 5; a[i++] = null);
B. String[] a = new String [5];
C. String[] a = {"", "", "", "", ""};
D. String[5] a;

Analyze the following code. public class Test {public static void main(String[] args) {int[] x = new int[3];System.out.println("x[0] is " + x[0]);} }

A. The program has a runtime error because the array element x[0] is not defineD.
B. The program runs fine and displays x[0] is 0.
C. The program has a compile error because the size of the array wasn't specified when declaring the array.
D. The program has a runtime error because the array elements are not initializeD.

答案查题题库