Examveda
Examveda

What will be the result if NullPointerException occurs at line 2?
try{
     //some code goes here
}
catch(NullPointerException ne){
     System.out.print("1 ");
}
catch(RuntimeException re){
     System.out.print("2 ");
}
finally{
     System.out.print("3");
}

A. 1

B. 3

C. 2 3

D. 1 3

E. 1 2 3

Answer: Option D


This Question Belongs to Java Program >> Exceptions

Join The Discussion

Comments ( 1 )

  1. Mahesh Babu
    Mahesh Babu :
    7 years ago

    some code goes here how to blindly analyze....

Related Questions on Exceptions