class TRYCATCH1
{
public static void main(String args[])
{
int x;
try
{
x = 10 / 0;
System.out.println(x);
System.out.println("IN TRY BLOCK");
}
catch (ArithmeticException e)
{
System.out.println("Div by zero is not possible");
}
catch (Exception e)
{
System.out.println("Exception occurred");
}
System.out.println("OUT OF TRY CATCH BLOCK");
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.