Почему не проходит?
package com.javarush.task.task14.task1419;
import java.util.ArrayList;
import java.util.List;
/*
Нашествие исключений
*/
public class Solution {
public static List<Exception> exceptions = new ArrayList<Exception>();
public static void main(String[] args) {
initExceptions();
for (Exception exception : exceptions) {
System.out.println(exception);
}
}
private static void initExceptions() { //the first exception
try {
float i = 1 / 0;
} catch ( NullPointerException e ){
exceptions.add(e);
} catch (ArrayIndexOutOfBoundsException e) {
exceptions.add(e);
} catch (IndexOutOfBoundsException e) {
exceptions.add(e);
} catch (NumberFormatException e) {
exceptions.add(e);
} catch (IllegalThreadStateException e) {
exceptions.add(e);
} catch (IllegalArgumentException e) {
exceptions.add(e);
} catch (ArrayStoreException e) {
exceptions.add(e);
} catch (ArithmeticException e) {
exceptions.add(e);
} catch (NegativeArraySizeException e) {
exceptions.add(e);
} catch (RuntimeException e) {
exceptions.add(e);
}
}
}