πŸ“Š JAVA
Q. What will be the output of the following Java program?
class exception_handling
{
public static void main(String args[])
{
try
{
int a[] = {1, 2,3 , 4, 5};
for (int i = 0; i < 5; ++i)
System.out.print(a[i]);
int x = 1/0;
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.print("A");
}
catch(ArithmeticException e)
{
System.out.print("B");
}
}
}
  • (A) 12345
  • (B) 12345A
  • (C) 12345B
  • (D) Compilation Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 12345B

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
55
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
89%
Success Rate