24.8k views
3 votes
What does the following statement do? double[] array1 = new double[10]; A. Declares array1 to be a reference to an array of double values B. Creates an instance of an array of 10 double values C. Will allow valid subscripts in the range of 0 - 9 D. All of the above

1 Answer

1 vote

Answer:

The answer is "Option D".

Step-by-step explanation:

In the given code an array that is "array1" is declared that stores double value because its data type is double. This array stores 10 element, that is equal, and between 0 to 9, because array indexing always starts from 0. In the given array declaration code all options are correct, that can be described as follows:

  • In option A, It is correct, because all element stores double value.
  • In option B, It is correct, because the size of the array is 10.
  • In option C, It is also correct, because it ranges between 0 to 9.
User Rabbit Guy
by
6.5k points