• Post Reply Bookmark Topic Watch Topic
  • New Topic

printStackTrace  RSS feed

 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i am trying to print the stacktrace of mainThread and newThread to see where the setName() method is placed.but i don't know how to
printStackTrace of this.please help me on this.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create a new Throwable object and then call printStackTrace()
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keith!

But new Throwable().printStackTrace(); it didn't print the fullstack trace.
i am confused on this program where the getName() is created either inside
the mainthread or new tread stack trace.thats why i need to print the full stack trace of both threads.Please help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!