Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Thread Debugging

The Thread class provides some support for debugging, by way of its dumpStack() and toString() methods. When called, the dumpStack() method prints a stack trace of the current thread. (If you examine the source code for that method, you will discover new Exception ("Stack trace").printStackTrace ().) The toString() method, when called, returns a string representation of the current Thread object. That representation is in the form Thread[thread-name,priority,thread-group].

  • + Share This
  • 🔖 Save To Your Account