printStackTrace()

I read something about this printStackTrace()?

May you give me example about this method? How to use the result of this method to find the problem?

printStackTrace() method provides the stacktrace of exception messages from the point of first occurence to all the replication till last occurence. It also gives the line number so that easy to debug.

This method gives the exception occured during compilation.

e.printStackTrace();

I’ll admit reading stack traces can be a bit overwhelming. Perhaps it would help if you post one that you have (relatively short please) that you’re trying to figure out.

Please give me real example by a code.