R

Ram Avtar Sharma • 4.50K Points
Extraordinary

Q. What will be the output of the following Java code?

Code:
class Output
{
public static void main(String args[])
{
try
{
int a = 0;
int b = 5;
int c = b / a;
System.out.print("Hello");
}
catch(Exception e)
{
System.out.print("World");
}
}
}
  • (A) Hello
  • (B) World
  • (C) HelloWOrld
  • (D) Compilation Error
  • Correct Answer - Option(B)
  • Views: 90
  • 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