https://www.geeksforgeeks.org/checked-vs-unchecked-exceptions-in-java/

1) Checked:are the exceptions that are checked at compile time. If some code within a method throws a checked exception,then the method must either handle the exception or it must specify the exception using_throws_keyword.

2) Unchecked

are the exceptions that are not checked at compiled time. In C++, all exceptions are unchecked, so it is not forced by the compiler to either handle or specify the exception. It is up to the programmers to be civilized, and specify or catch the exceptions.

In Java exceptions under

Error

and

RuntimeException

classes are unchecked exceptions, everything else under throwable is checked.



results matching ""

    No results matching ""