Exemptions checked in unchecked



  • You can explain why they're turning around. checked exemptions unchecked Java? What does that give? If not mistaken, it is not recommended to process unchecked Exceptions.



  • If your code is exceptional. checkedthat means you need to process them with help. try-catch or call for a global exemption process that selects these exemptions.

    If the exception is not processed, then the method should be noted as throws It's an exception.

    In some cases, this is not possible, for example, if the method overlaps the external interface in which the treatment of exemptions is mandatory, the method ' s signature cannot be changed by adding throws and the method shall close the interface.

    If the exception is waived as unchecked, it can be catched later, but it won't be recommended because it does not allow for exemptions to be processed, and the programme is not working.

    Here. https://ru.stackoverflow.com/a/901527/204920 , this answer also refers to how to do the opposite, i.e. to catch up. unchecked Exemptions and exclusion checked

    To understand better than different unchecked exemptions checkedMay be read https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html ♪

    That's what Oracle writes about:

    “If a client can reasonably be expected to recover after an exception, make him checked Except. If a client can't do anything to recover after graduation, do it. unchecked “except”.

    It is therefore not recommended that one type of exception be introduced into another type because we cannot change the client's ability.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2