Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of printStackTrace

 
Shivit Agarwal
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At what instance and what is the use of this printStackTrace() method. If possible explain with a code ??
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At what instance and what is the use of this printStackTrace() method.


Who can told you better than Java Docs (API) , here

code :

You can try it at home,
make a simple program which explicitly throw some exception , handle this exception in catch block and call printStackTrace() on exception object ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic