-
What is the output of this program?
public class exception_Example
{
public static void main(String args[])
{
try
{
System.out.print("Interview" + " " + 15 / 0);
}
catch(ArithmeticException e)
{
System.out.print("Mania");
}
}
}
-
- Interveiw
- Mania
- Compilation Error
- Runtime Error
- None of these
Correct Option: B
System.ou.print() function first converts the whole parameters into a string and then prints, before “Interview” goes to output stream 15 / 0 error is encountered which is cached by catch block printing just “Mania”.