/* 非法參數 */
throw new IllegalArgumentException("name cannot be null");
/* 非法狀態 */
throw new IllegalStateException("this file is already locked and cannot be changed");
/* 不支持的操作 */
throw new UnsupportedOperationException("can't manpulate the file");
空指針異常: NullPointerException
類找不到: ClassNotFoundException
越界異常:
IndexOutOfBoundsException
沒有訪問權限異常:
IllegalAccessException