вроде 10
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 (ArithmeticException e) { //1
exceptions.add(e);
} catch ( NullPointerException e ){ //2
exceptions.add(e);
} catch (ArrayIndexOutOfBoundsException e) { //3
exceptions.add(e);
} catch (IndexOutOfBoundsException e) { //4
exceptions.add(e);
} catch (NumberFormatException e) { //5
exceptions.add(e);
} catch (IllegalThreadStateException e) { //6
exceptions.add(e);
} catch (IllegalArgumentException e) { //7
exceptions.add(e);
} catch (ArrayStoreException e) { //8
exceptions.add(e);
} catch (RuntimeException e) { //9
exceptions.add(e);
}catch (Exception e) { //10
exceptions.add(e);
}
//напишите тут ваш код
}
}