The exception description in Java is a method that Java enforces in order to inform the client programmer of the type of exception that a method might throw in a polite manner.
The wording is as follows:
void F () throws exception1,exception2 .... {code block}
Indicates that this method does not throw these exceptions (except for exceptions inherited from RuntimeException, which can be thrown without exception descriptions), but there is a place where you can cheat and declare that the method throws an exception, but it is not actually thrown. The compiler believes in this exception and takes a position for the exception before it can throw the exception without modifying the existing code.
If written in the following form, the method will throw a type of exception type:
void G () throws Exception1,exception2 ....
{
Code block ....
throw new Exception1 ();
}
Java Exception Description Learning Diary