1It occurs when there is an error
2in the aritchmatic logic. For
3Example we can't divide int to 0.
4In this case it will throw arithmatic
5exception and we can handle with
6try catch block.(unchecked exception)
1class Example1
2{
3 public static void main(String args[])
4 {
5 try{
6 int num1=30, num2=0;
7 int output=num1/num2;
8 System.out.println ("Result: "+output);
9 }
10 catch(ArithmeticException e){
11 System.out.println ("You Shouldn't divide a number by zero");
12 }
13 }
14}