Multiple choice

How to get the descriptive information about the exception occurred in a program?

  1. multiple catch statements

  2. single catch with exception type as Exception

  3. printQueueTrace();

  4. printStackTrace();

  5. printLinkedlistTrace();

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

All exceptions inherit a method printStackTrace() from Throwable class. Its stores all the exceptions in stack manner and prints them out, when it is called.