πŸ“Š 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 < 7; ++i)
System.out.print(a[i]);
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.print("0");
}
}
}
  • (A) 12345
  • (B) 123450
  • (C) 1234500
  • (D) Compilation Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 123450

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
59
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
87%
Success Rate