A checked exception in Java represents a predictable, erroneous situation that can occur even if a software library is used as intended. For example, if a developer tries to access a file, the Java IO library forces them to deal with the checked FileNotFoundException.
What are checked exceptions examples?
ClassNotFoundException, IOException, SQLException etc are the examples of the checked exceptions.
How to throw checked exception in Java?
Using the Throws keyword
We can throw either checked or unchecked exceptions. The throws keyword allows the compiler to help you write code that handles this type of error, but it does not prevent the abnormal termination of the program.