[問題] Exception的問題

看板java作者 (佑子)時間19年前 (2006/04/16 12:45), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
程式碼大致如下 ===================================================================== public class Translator extends Loader{ public static void main(String args[]) throws Exception{ new Translator().Translator(); } public void Translator() throws Exception{ try{ ...... unit(refPath); ...... moveFile(refPath,array[i]); ...... }catch(IOException e){ throw new IOException(e.getMessage()); }catch(SQLException e){ throw new SQLException(e.getMessage()); }catch(Exception e){ throw new Exception(e.getMessage()); }finally{ ......... } } public void unit(String refPath) throws Exception{ try{ ...... }catch(Exception e){ throw new Exception(e.getMessage()); } } public void moveFile(String refPath,String limitFile) throws IOException{ try{ ....... }catch(IOException ie){ throw new IOException(ie.getMessage()); } } } ========================================================================= 出現unreported exception java.lang.Exception; must be caught or declared to be thrown 我有catch到IOException、SQLException、Exception 但是還是會出現這樣的錯誤訊息 請問為什麼呢 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.126.44.149
文章代碼(AID): #14GSlf4D (java)
討論串 (同標題文章)
文章代碼(AID): #14GSlf4D (java)