The java documentation says that it's mandatory for a checked exception to specify an handler that can "catch" the exception or to throws it in the method declaration. But, if i do, for example:
public class DivZero{
public static void main(String[] args){
int a=10;
int[] b={1,2,3,4,0};
for (int i=0;i<b.length;i++){
System.out.println(a/b[i]);
}
}
}
It works fine also without "try-catch" or "throws" declaration. It throws a java.lang.ArithmeticException. So, it's not mandatory? The compiler implicitly throws the suitable Java "Throwable" class in the same way. It's so?