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

Code:
class exception_handling 
{
    public static void main(String args[]) 
    {
        try 
        {
            System.out.print("A");
            throw new NullPointerException ("Hello");
        }
        catch(ArithmeticException e) 
        {
            System.out.print("B");         
        }
    }
}
  • (A) A
  • (B) B
  • (C) Hello
  • (D) Runtime Exception
πŸ’¬ Discuss
βœ… Correct Answer: (D) Runtime Exception

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
117
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Neelam Mittal
Publisher
πŸ“ˆ
97%
Success Rate