作者oabgg (佑子)
看板java
标题[问题] Exception的问题
时间Sun Apr 16 12:46:46 2006
程式码大致如下
=====================================================================
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