What Classes of Exceptions May be Thrown by a Throw Statement
A throw statement may throw any expression that may be assigned to the Throwable type. In Java, the throw statement is used to explicitly throw an exception. When you use the throw statement, you typically throw an instance of a class that extends either Throwable, which is the base class for all exceptions and errors, or one of its subclasses. The two main subclasses of Throwable are: Exception: This is the class most commonly used for exceptional conditions that a program should…