R

Ritu Singhal • 4.36K 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");
       } 
       finally 
       {
           System.out.print("World");
       } 
    }
}
  • (A) Hello
  • (B) World
  • (C) HelloWOrld
  • (D) WorldWorld
  • Correct Answer - Option(D)
  • Views: 10
  • 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.

Be the first to start discuss.


Question analytics