int[] scores = new double[25];

A good answer might be:

scores[ 0 ]OK
scores[1]OK
scores[ -1 ]illegal
scores[ 10]OK
scores[ 25 ]illegal
scores[ 24 ]OK

More on Array Declaration

Lacking any other information, the slots of an array are initialized to the default value for their type. Each slot of a numeric array is initialized to zero.

Of course, the program can assign values to slots after the array has been constructed:

class arrayEg1
{
  public static void main ( String[] args )
  {
    int[] stuff = new int[5];

    stuff[0] = 23;
    stuff[1] = 38;
    stuff[2] = 7*2;

    System.out.println("stuff[0] has " + stuff[0] );
    System.out.println("stuff[1] has " + stuff[1] );
    System.out.println("stuff[2] has " + stuff[2] );
    System.out.println("stuff[3] has " + stuff[3] );
    System.out.println("stuff[4] has " + stuff[4] );
  }
}


QUESTION 7:

What does the above program write to the monitor?

stuff[0] has
stuff[1] has
stuff[2] has
stuff[3] has
stuff[4] has