It is a good practice to use finally block especially when you are dealing with system resources, such files or connections. All connections can be closed in the finally block. If an exception was thrown then it can happen that you may miss to execute some clean up code and leave resources allocated, or objects in an inconsistent state.
It is a good practice to use finally block especially when you are dealing with system resources, such files or connections. All connections can be closed in the finally block. If an exception was thrown then it can happen that you may miss to execute some clean up code and leave resources allocated, or objects in an inconsistent state.