Which of the following exception will be thrown due to the statement given here?



A. NullPointerException
B. NegativeArraySizeException
C. ArrayIndexOutOfBoundsException
D. IndexOutOfBoundsException
E. This statement does not cause any exception.

題解

由於在實體化陣列時定義的陣列長度小於0,因此會拋出NegativeArraySizeException例外。