Does return “happen after” finally?

后端 未结 4 1030
时光取名叫无心
时光取名叫无心 2020-12-05 17:29

I am trying to convince myself that actions taken in the finally clause happen before the function return (in the memory consistency sense). From the J

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 18:27

    The finally clause shall execute no matter what is the result or behaviour of the try block, so the finally gets executed before the return.

提交回复
热议问题