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
πŸ’¬ Discuss
βœ… Correct Answer: (D) WorldWorld

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
124
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ritu Singhal
Publisher
πŸ“ˆ
95%
Success Rate