标题: IO流的 有点搞不清楚 [打印本页] 作者: GAREN 时间: 2016-5-31 18:06 标题: IO流的 有点搞不清楚 import java.io.*;
public class Mine {
public static void main(String argv[]){
Mine m=new Mine();
System.out.println(m.amethod());
}
public int amethod() {
try {
FileInputStream dis=
new FileInputStream("Hello.txt");
}catch (FileNotFoundException fne) {
System.out.println("No such file found");
return -1;
}catch(IOException ioe) {
} finally{
System.out.println("Doing finally");
}
return 0;
}
}
A. No such file found
B. No such file found ,-1
C. No such file found, Doing finally, -1
D. 0 作者: zhanghongtuo 时间: 2016-5-31 18:15
我认为选C
先抛出异常,执行到return之前,再执行finally,再返回catch中的return作者: GAREN 时间: 2016-6-2 00:51