-
What is the output of this program?
public class exception_Example
{
public static void main(String args[])
{
try
{
int p, q;
q = 0;
p = 13 / q;
System.out.print("welcome to");
}
catch(ArithmeticException e)
{
System.out.print("Interview");
}
finally
{
System.out.print(" Mania");
}
}
}
-
- welcome to
- Interview Mania
- Interview
- Mania
- None of these
Correct Option: B
finally keyword is used to execute the code before try and catch block end.