Skip to main content

Questions tagged [finally]

The finally block always executes after a try block, regardless of how the control exits the block.

Filter by
Sorted by
Tagged with
-1 votes
5 answers
5k views

I'm doing some cleanup operations that could throw an exception, and I want to implement the logic of a finally block, but only if no exceptions are thrown: The initial implementation is this: ...
thecoop's user avatar
  • 539
2 votes
1 answer
570 views

Background My program communicates with a device that is usually asynchronous, but can sometimes behave synchronously. I have an event handler that I use for receiving the data asynchronously, then I ...
Snoop's user avatar
  • 2,758
8 votes
2 answers
6k views

I like using final variables whenever possible. Often those variables have to be closed afterwards. Note that I'm currently working on Java 6 so there is not closeable interface, but the same applies ...
rath's user avatar
  • 886
12 votes
5 answers
2k views

First, I am well aware of Why is there no 'finally' construct in C++? but a lengthy-growing comment discussion on another question seems to warrant a separate question. Apart from the issue ...
Martin Ba's user avatar
  • 7,861
2 votes
1 answer
550 views

Which programming language first came up with the finally block? I ask purely out of curiosity. It is a very useful piece of syntactic sugar, and whoever first created it surely has a very ...
patstuart's user avatar
  • 653