Pieter Jacobs wrote:Hi guys,
1- When will you really use "throw" (an exception), and when "System.out.println" (whether to print the stacktrace or whatever) ?
example:
2- When using "Properties", you use a FileInputStream which is declared within a "try / catch" block; do I use "throw" in this case (within the "catch" block) meaning that the app should terminate because it can not continue if it does not get the value from the properties file ?
It was difficult to put this into words; I hope it makes sense!
Cheers,
Pieter
SCJP, SCJD
SCJP 1.5, SCJD 1.6
Fernando Franzini - Java Blog
Fernando Franzini wrote:What should I do when catch some exception that I dont pass way ? I mean,...in some cases it dont make sense throw exception to callers...
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Fernando Franzini - Java Blog
I can't take it! You are too smart for me! Here is the tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|