看板 java 關於我們 聯絡資訊
※ 引述《vc.bbs@bbs.mgt.ncu.edu.tw (vincent)》之銘言: : 有些 Exception 的狀況有點一知半解, 想請教各位. 當一個 class 發生 Exception 時, : 是否後續的程式碼都不再執行? 如果是沒有被handle的exception 程式就會自動終止 : 如果有 5 個 class 都 extend Thread, 當這 5 個 thread 都 run 起來後, 如果其中 : 一個 thread 發生 Exception, 是否會影響其他 thread 執行? 同上 只要有發生非預期的例外程式就會自動終止 但是可以使用 try catch 敘述去抓取預期的例外並做對應處理。 -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the complier will stack.push(scouting.buck()); | answer your life -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.240.60 ※ 編輯: TonyQ 來自: 140.138.240.60 (02/18 06:49)