P

Priyanka Tomar • 35.28K Points
Coach

Q. What will be the output of the following Java program?
class exception_handling
{
public static void main(String args[])
{
try
{
System.out.print("Hello" + " " + 1 / 0);
}
catch(ArithmeticException e)
{
System.out.print("World");
}
}
}

  • (A) Hello
  • (B) World
  • (C) HelloWorld
  • (D) Hello World
  • Correct Answer - Option(B)
  • Views: 45
  • Filed under category JAVA

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.


Question analytics