Вопрос

For what is can see, the only difference between putting code inside finally block and outside finally block is that the code inside finally block will be executed when if there is an uncaught exception while code after try-catch-block that is not inside finally-block will not be executed. am i correct or there are more differences?

Это было полезно?

Решение

finally is code you want your try block to execute no matter what (when an exception is thrown, when an exception is not thrown, and even when your block has a return statement executed).

Другие советы

am i correct

Yes.

or there are more differences?

Nope!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top