• java异常概述(简版)


    1:ArithmeticException

      说明:当存在不符合规则的运算条件时出现这种问题,例如被除数为0的情况。

    2:ArrayIndexOutOfBoundsException

      说明:使用非法索引时抛出此异常,例如索引为负数等情况

    3:IndexOutOfBoundsException

      说明:索引(角标)越界,例如数组长度为1时,获取索引为2的情况下

    4:ArrayStoreException

      说明:数组存储异常,即数组的类型和存入数据的类型不匹配。

    5:ClassCastException

      说明:类转换异常,例如强行将类转换为不是实例的子类

    6:IllegalArgumentException

      说明:参数不合法或参数不正确的情况。

    7:NegativeArraySizeException

      说明:试图创建非法的数组,数组长度不合法的情况,例如长度为负数。

    8:NullPointerException

      说明:空指针异常,例如程序需要某个对象的某个属性,但是这个对象为null就会抛出此异常。

    9:NumberFormatException

      说明:程序试图将一个字符串转换为数值的情况。

    10:StringIndexOutOfBoundsException

      说明:索引(角标)越界,指的是字符串。

    11:ClassNotFoundException

      说明:找不到对应的类,列入spring中,需要的类没有注解则会抛出此异常。

    12:NoSuchMethodException

      说明:此方法不存在,例如maven项目中新增方法而没有编译。则会抛出此类问题。

  • 相关阅读:
    1323. Maximum 69 Number
    1217. Play with Chips
    1296. Divide Array in Sets of K Consecutive Numbers
    1288. Remove Covered Intervals
    1290. Convert Binary Number in a Linked List to Integer
    1295. Find Numbers with Even Number of Digits
    1306. Jump Game III
    1305. All Elements in Two Binary Search Trees
    1304. Find N Unique Integers Sum up to Zero
    浅谈 JSON.stringify 方法【转】
  • 原文地址:https://www.cnblogs.com/huayuxiaoxiang/p/8252530.html
Copyright © 2020-2023  润新知