This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Use of printStackTrace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Use of printStackTrace" Watch "Use of printStackTrace" New topic
Author

Use of printStackTrace

Shivit Agarwal
Ranch Hand

Joined: Feb 28, 2008
Posts: 82
At what instance and what is the use of this printStackTrace() method. If possible explain with a code ??


Have the determination of mirror which never fails to reflect in spite of being broken into pieces.<br /> <br />Kiss the hands you cannot bite.<br /> <br />An Optimist is one who starts taking a bath when he accidentally falls into the water.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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 ..


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
 
subject: Use of printStackTrace