Junior — Middle
Can you name classes that are descendants of the Throwable class?
sobes.tech AI
Answer from AI
In Java, the Throwable class is the superclass of all errors and exceptions. Its main subclasses are:
- Exception — a class for exceptions that can be handled (e.g., IOException, SQLException).
- Error — a class for errors that are usually not handled by the application (e.g., OutOfMemoryError, StackOverflowError).
Thus, all user-defined exceptions typically inherit from Exception, and system errors from Error.