In my code I am trying to handle and Arithmetic Exception in eclipse java. My code is running fine in windows but its giving some Fatal error in Mac although it is working fine for other kinds of exception like IndexOutOfBound. And I am getting no idea that what is the problem.So below is my code and error that is showing.
public class ExceptionHandling {
public static void main(String[] args) {
try{
int num1=30, num2=0;
int output=num1/num2;
System.out.println ("Result: "+output);
}
catch(ArithmeticException e){
System.out.println ("You Shouldn't divide a number by zero");
}
}
}
Thankyou it might seems to be a silly question but I would appreciate your help thanks in advance.