But this other page says... "Note that the finally block is executed always except when the return statement is executed."
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.6
Subrata Pradhan wrote:is there any way to stop execution of finally block using deamon thread?? actually few days back one IBMer guy told me that we can stop the execution of finally block using deamon thread...so if its possible.. please explain...
Subrata Pradhan wrote:is there any way to stop execution of finally block using deamon thread?? actually few days back one IBMer guy told me that we can stop the execution of finally block using deamon thread...so if its possible.. please explain...
Matthew Brown wrote:
Subrata Pradhan wrote:is there any way to stop execution of finally block using deamon thread?? actually few days back one IBMer guy told me that we can stop the execution of finally block using deamon thread...so if its possible.. please explain...
My guess is what he meant is that a program exits when the last non-daemon thread ends. So daemon threads can be terminated abruptly. Which means that there may be cases where a finally block is not executed in a daemon thread, whereas in a non-daemon thread once the corresponding try block is entered then the finally block is guaranteed to run.
Rob Spoor wrote:
Since either the try block or the catch block finishes, there is no need for a return statement in the finally block.
Frederico Cunha wrote:The finally block is executed even if you have the "throw" and you actually end up changing the function's result.
Joanne
Consider Paul's rocket mass heater. |