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
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|