Differences between Runtime/Checked/Unchecked/Error/Exception

前端 未结 8 939
走了就别回头了
走了就别回头了 2020-11-27 05:17

What are the Runtime exceptions and what are Checked/Unchecked Exceptions and difference between Error/Exception.Why these many types? Instead Java may simply follow a simpl

8条回答
  •  温柔的废话
    2020-11-27 05:57

    • Error (throws by VM, should not be caught or handled)
      1. VM Error
      2. Assertion Error
      3. Linkage Error ...so on
    • Runtime/Uncheck Exception(programming error, should not be caught or handled)
      1. NullPointerException
      2. ArrayIndexOutOfBoundException
      3. IllegalArgumentException ... so on
    • Check Exception(Anything Else, Applications are expected to be caught or handled)
      1. IOException
      2. FileNotFoundException
      3. SQLException ...so on

提交回复
热议问题