You are on page 1of 1

import java.lang.

*;
import java.io.*;
public class Exceptionhandler
{
public static void main(String[] args){
int a=10;
int b=0;
System.out.println("Trying to throw exception");
try
{
int c=a/b;
}
catch(ArithmaticException q)
{
System.out.println("exception caught through "+ e);

}
System.out.println("End of main exception");

}
}

You might also like