(#132)TRUE or FALSE:if an exception is not caught,the finally block will run and the rest of the method is skipped. Answer:TRUE The finally block will always run if an exception is thrown,and then the exception is immediately passed to the calling method. ***************************************************** I found the above question in the Rules Roundup Game(the answer given in the review section is also attached). The answer says TRUE.But i strongly believe that the answer must be FALSE.Irrespective of whether an Exception is caught or not,the code in the Finally block is executed and the rest of the method is not skipped. Any Exceptions??
(#132)TRUE or FALSE:if an exception is not caught,the finally block will run and the rest of the method is skipped. - TRUE. The question does not say "only when it is not caught". There is a difference. As far as this question is concerned, it is TRUE. May be the following question's answer is FALSE. TRUE or FALSE: The finally block will run and the rest of the method is skipped only when an exception is not caught
[This message has been edited by Alagu Seenivasan (edited October 05, 2000).]
Hi Irshad, The answer is TRUE. Just because the finally block runs if an exception is not caught doesn't mean that the finally block doesn't if an exception *is* caught, right? It's like saying if A then B implies if B then A. You know it's not always true Cheers
hi irshad, the term "Rest of the method" in the question implies the code that is after the try - catch -finally block. It does not refer to the finally block it self, because the question itself says that the finally block is getting executed.
hi friend, >Irrespective of whether an Exception is caught or not,the code >in the Finally block is executed and the rest of the method is >not(?!) skipped. an exception is caught or not really does matter: If no catch clause handling an exception can be found, then the current thread (the thread that encountered the exception) is terminated, but only after all finally clauses have been executed and the method uncaughtException has been invoked for the ThreadGroup that is the parent of the current thread - the rest of the metod is skipped ! If the exception has been dealt with in a catch block, normal exectution resumes - the rest of the method get run! hope this will help rong chen
posted 19 years ago
that was great guys, Thanks
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad: