题目内容

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

Assume int[] t = {1, 2, 3, 4}. What is t.length?

A. 4
B. 5
C. 0
D. 3

The array size is specified when the array is declareD.

A. true
B. false

Consider the following code fragment: int[] list = new int[10]; for (int i = 0; i <= list.length; i++) {list[i] = (int)(Math.random() * 10); } Which of the following statements is true?

A. The loop body will execute 10 times, filling up the array with zeros.
B. The loop body will execute 10 times, filling up the array with random numbers.
C. list.length must be replaced by 10
D. The code has a runtime error indicating that the array is out of bounD.

答案查题题库