1、抛出参数异常
throw new IllegalArgumentException("maxSize <= 0");
2、空指针异常
throw new NullPointerException("key == null");
3、不合理或者不正确状态异常
throw new IllegalStateException(getClass().getName() + ".sizeOf() is reporting inconsistent results!");
1、抛出参数异常
throw new IllegalArgumentException("maxSize <= 0");
throw new NullPointerException("key == null");
throw new IllegalStateException(getClass().getName() + ".sizeOf() is reporting inconsistent results!");