Is there such case when in try\finally block the finally won't be executed?

后端 未结 4 1917
日久生厌
日久生厌 2020-12-07 00:49

I\'m studying for my test in Object Oriented Programming and I was wondering if there is any case what so ever that considering the following code:

try {
            


        
4条回答
  •  甜味超标
    2020-12-07 01:32

    The Java Language Specification guarantees that finally is invoked before the try-statement completes.

    The try statement might not complete for the usual reasons, which have been enumerated in Borealid's answer.

提交回复
热议问题