Searching for: Exception Handling in Java
Declaring an Exception
Language: Java

Apart from the built in exceptions Java provides, exception classes can be written by the programmer. These can then be thrown like the built-in Java exceptions.

Throwing an Exception
Language: Java

Methods prone to an error in runtime can throw an exception, instead of having program crash or having a logical error within the program.