What exception does LINE A throw?
Correct Answer : C
Here, the exception thrown is
NullPointerException because the array
a is initilaised to
null and later, an expression is evaluated. In the expression the elements of a
null array are accessed, which causes the
The answer is C.
Topic: Why Java Throws Exceptions