227. Methods of Throwable Class

Pre-requisites -

Please find the methods of Throwable Class in the below diagram -

As a tester, we generally use the following three methods while writing automation scripts in Java language -
  1. getMessage( )  
  2. toString( )
  3. printStrackTrace( )
Hence I will explain and implement the above three methods in the upcoming posts. And the remaining three methods in the above diagram wont be explained in my blog. 

As these methods belong to Throwable Class, we can also use them with all the sub-classes of the Throwable Class say Exception Class, ArithmeticException Class etc. 

All these methods are used to print the exception details of the thrown exception (i.e. object). Lets implement them one by one in the next posts.

Please comment below to feedback or ask questions.

Printing exception details in different ways will be explained in the next post.

No comments: