Back

Explore Courses Blog Tutorials Interview Questions
0 votes
5 views
in Java by (6.5k points)
How does it contribute towards exception handling?

1 Answer

0 votes
by (11.3k points)

The superclass of all exceptions and errors in Java is called the Throwable class. The objects that have been created as instances of this class or their subclasses can be thrown by the JVM or by the throw statement that Java has. In a similar way, only this class or a subclass of this class can be used as an argument type in a catch statement. At any given point of time of the execution, the Throwable class contains the execution stack of the particular thread it is being used in. This way errors can be documented as well. 

If you're looking to learn java, using proper exception handling will help you to prepare for the industry in a competent manner. 

Related questions

Browse Categories

...