| Author |
Exceptions
|
josephine chen
Ranch Hand
Joined: Oct 29, 2002
Posts: 216
|
|
Check my answer To prevent code which follows a try block from being executed when an exception is caught, you can: does this mean statements under tryblk --finally or other statements or both??? a) Code an end clause. //f b) Code a return statement in the finally clause. //u cannot have statements underneath this compiler gives error c) Code a return statement in the catch clause. //excutes finally but not statements underneath d) Call System.exit() in the catch clause. //does not execute finally
|
 |
Sridhar Garimella
Ranch Hand
Joined: Feb 18, 2000
Posts: 73
|
|
Check my answer To prevent code which follows a try block from being executed when an exception is caught, you can: does this mean statements under tryblk --finally or other statements or both??? a) Code an end clause. //f b) Code a return statement in the finally clause. //u cannot have statements underneath this compiler gives error c) Code a return statement in the catch clause. //excutes finally but not statements underneath d) Call System.exit() in the catch clause. //does not execute finally I think with respect to this situation c and d are correct.Because finally is a optional one.So, there is no problem if finally is not present.I think the context of this question is finally is not present.Then straight the asnwers are c and d
|
Thanks,<br />Sridhar.
|
 |
 |
|
|
subject: Exceptions
|
|
|