A

Admin • 828.03K Points
Coach

Q. Given the code. What is the result when this program is executed?
public class Test{
static int x[];

static{
x[0] = 1;
}

public static void main(String args[]){
}
}

  • (A) ArrayIndexOutOfBoundsException is thrown
  • (B) ExceptionInInitializerError is thrown
  • (C) IllegalStateException is thrown
  • (D) IllegalStateException is thrown D. StackOverflowException is thrown
  • Correct Answer - Option(B)
  • Views: 13
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.