
class ArithmeticExceptiontest { public static void main(String args[]) { int num1 = 0; int num2=10; int num3=0; try { num3=num2/num1; System.out.println("The result =" +num3); } catch( ArithmeticException e) { System.out.println("Division by Zero is done" +e); } } } trows incampatble type error

Hi Friend,
Your code works fine here.
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.