0
Checked exception in java
Can someone please give an example of "default throw and default catch" for checked exception.
3 Respostas
+ 4
Try this:
https://code.sololearn.com/c8u1ZxXjQg3E
It catches all exceptions. nextInt generates a couple exceptions demostrated by first two test cases. The third test case uses the throw for being out of range. The fourth test case runs sucessfully. Each of the following lines is a unique test case that you should enter to the input prompt individually:
no input (just submit)
a
0
5
+ 1
No I think this example is for unchecked exception as it has IllegalArgumentException which is a type of unchecked exception.
I am asking for checked exception example (like IOException) in case of "default throw and default catch).
I know an example of
https://code.sololearn.com/cCbC2dVDif1F/?ref=app
0
thanks