0
Exception messages
In how many ways can we print exception messages in java ?
2 Answers
+ 1
One way is *ExceptionName*.getMessage();
If u name exception e that would be like e.getMessage(); That is the one that I use all the time.
+ 1
I suggest printStackTrace() that gives you the error message and where the error occurred in the code. If your error is called e then the syntax is e.printStackTrace();