try ……catch和throw的區別

Try…catch…finally與直接throw的區別:try catch是直接處理,處理完成以後程序繼續往下執行,throw則是將異常拋給它的上一級處理,程序便不往下執行了。web public class ZeroTest { public static void main(String[] args) { try{ int i = 100 / 0;
相關文章
相關標籤/搜索