Why finally?
- From: "Jon Davis" <jon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Apr 2006 23:32:40 -0700
I understand that the finally sub-block will execute regardless of whether
try succeeded or not. But so will code that follows try...catch. So then
what is the difference between ...
try {
do.something.that.breaks();
} catch {
do.something.that.works();
}
cleanup();
... and ..
try {
do.something.that.breaks();
} catch {
do.something.that.works();
} finally {
cleanup();
}
... other than organizational aesthetics ??
Thanks,
Jon
.
- Follow-Ups:
- Re: Why finally?
- From: Magnus
- Re: Why finally?
- From: Willy Denoyette [MVP]
- Re: Why finally?
- From: Jon Skeet [C# MVP]
- Re: Why finally?
- Prev by Date: Re: Updating DataTable based on Criteria
- Next by Date: Re: Converting an Array to a Collection
- Previous by thread: RE: Creating a Linear Gradient Panel
- Next by thread: Re: Why finally?
- Index(es):