Creating an exception object and handing it to the runtime system is called throwing an exception.
1. checked exception
All exceptions are checked exceptions, except for those indicated by Error
, RuntimeException
, and their subclasses.
2. unchecked exceptions
Errors and runtime exceptions are collectively known as unchecked exceptions.