Run Time Errors Practice

Question 1 of 2

Consider the following code:

Object[] objects = new Object[20];

for(int i = 0; i < objects.length; i++) {

switch(i % 4) {

case 0:

objects[i] = new Integer(i + 3);

break;

case 1:

objects[i] = "This val: " + i;

break;

case 2:

objects[i] = new Double(i * 4.4);

break;

case 3:

objects[i] = "That val: " + (i*12);

break;

}

}

String s = (String)objects[8];

System.out.println(s);

What is the error in the code above?