0
What will use exception in java
1 Answer
+ 2
A good use case to help your understanding of the application of exceptions is that youâre creating a library (or collection of code) where thereâs a function that sends a HTTP request in order to receive information on some cats.
It is important that the library developer throws an exception if the connection is refused.
It is equally important that the developer CATCHES the exception so that they execute fallback code like displaying a picture of a sad cat with the label âunable to connectâ.