Java Try Catch Finally blocks without Catch

后端 未结 11 785
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 20:38

I\'m reviewing some new code. The program has a try and a finally block only. Since the catch block is excluded, how does the try block work if it encounters an exception

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 21:26

    Don't you try it with that program? It'll goto finally block and executing the finally block, but, the exception won't be handled. But, that exception can be overruled in the finally block!

提交回复
热议问题