Reason
It's not verifying
package com.codegym.task.task14.task1419;
import com.sun.jdi.AbsentInformationException;
import java.lang.annotation.AnnotationTypeMismatchException;
import java.util.ArrayList;
import java.util.List;
/*
Exception invasion
*/
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 (Exception e) {
exceptions.add(e);
}
try {
throw new NullPointerException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new ClassCastException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new ArrayIndexOutOfBoundsException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new AbsentInformationException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new NegativeArraySizeException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new AbsentInformationException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new NoSuchMethodException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new NumberFormatException();
}
catch (Exception e)
{
exceptions.add(e);
}
try {
throw new ArrayStoreException();
}
catch (Exception e)
{
exceptions.add(e);
}
}
}