Questions tagged [finally]
The finally block always executes after a try block, regardless of how the control exits the block.
5 questions
-1
votes
5
answers
5k
views
Finally block when no exceptions thrown
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:
...
2
votes
1
answer
570
views
Event subscription in finally clause
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 ...
8
votes
2
answers
6k
views
How to get around non-initialized objects in the `finally` block?
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 ...
12
votes
5
answers
2k
views
What is the conceptual difference between finally and a destructor?
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 ...
2
votes
1
answer
550
views
Which programming language first came up with the finally block?
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 ...