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) ?
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!
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...
"throw some kind of runtime exception IllegalStateException("database is corrupted")"