Thread dumpStack() method in Java

Method declaration Рpublic static void dumpStack().

This method is used only for debugging purpose. Internally this method is calling printStackTrace() method only.

This method will always throw an exception.

Output is –

java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at multithreading.ThreadDumpStackExample.main(ThreadDumpStackExample.java:5)

 

Top