Things you need to remember when using finally in Java

Posted by & filed under java.

Because Java has a Garbage collector and you don’t know for sure when your object will be destroyed it is tricky to do proper resource management, in comparison with C++ where objects are created on the stack or you control their lifecycle manually by new/delete operator. To help you deal with that, the finally block was… Read more »