0
what does this mean .Anybody help me understand this
e.printStackTrace();. In Java https://code.sololearn.com/cs0b0kurJ2Ib/?ref=app
1 Answer
+ 1
If something unexpected happened during programm execution, JVM will throw an exception. It will create an object of specific type with some fields and methods, this object will have details about what happened and where. In try/catch block you tring to predict such behaviour and "catch" Exception object, you refer it as "e" and e.printStackTrace(); is call to the method that will print to standard output (console) details where this error appears, during execution. Stack is a part of JVM wich is region of the memory where executable code is actually beeng executed so with this method you will get an list of instructions that were executed when error happened.