What is e.printStackTrace(😃) ?
See here ...
👉 e.printStackTrace(😃 )
============ = = = = =
============ = = = = =
e:-reference of ur Exception PrintStackTrace() is a runtime method present in side StackTrace class
👉Internally in java there is a class whose name is StackTrace. ...It doing a crucial role in jvm.
👉StackTrace class contain several method through which he knows all the details of what happened on current thread execution. Which method is executed? How much memory occupied for method? How many stack frame are created in java stack area inside jvm memory. ..so it know all the details of ur current running Thread
👉So what happened when you write e.PrintStackTrace() ....
Internally u give ur current exception reference I.e e and when ur code execute
Then jvm tell to StackTrace class hey stackTrace some one give me exception reference plz take that reference and then trace in stack and see what problem going on then print them. ...
Then jvm tell to StackTrace class hey stackTrace some one give me exception reference plz take that reference and then trace in stack and see what problem going on then print them. ...
👉So if you not write this explicitly also e.printStackTrace ( ) is internally place in ur code. We can say e.printStackTrace ( ) method is by default avilable in ur catch block. ........
Comments
Post a Comment