Bloomberg interview question

In c++, how to implement "finally" block in java