Version: SE 8
User Program Communication
Object Oriented Programming
Searching for: Exception Handling in Java
Declaring an Exception
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
Methods prone to an error in runtime can throw an exception, instead of having program crash or having a logical error within the program.