多选题 What is the output of the following code segment?
String[] numbers = {"One", "Two", "Three"};
System.out.println(numbers[3]+" "+numbers[2]+" "+
numbers[1]);
  • A. One Two Three
  • B. Three Two One
  • C. A compile time error will be generated.
  • D. A runtime exception will be thrown.
【正确答案】 D
【答案解析】数组索引开始于0。numbers[3]变量会抛出一个运行时ArrayIndexOutOfBoundsException。A、B和C不正确。如果每个索引都少1,B将是正确答案。