在try-catch语法中,FileNotFoundException和IOExceptipon的catch语句的编写顺序重要吗?
发布于 2015-04-09 18:44:03
IOException是FileNotFoundException .So fist catch子类的超类,即FileNotFoundException,然后您需要捕获IOException
例如,
try{
// something
} catch(FileNotFoundException fne){
// Handle the exception here
} catch(IOException ioe) {
// Handle the IOException here
}https://stackoverflow.com/questions/11667238
复制相似问题