import java.io.*;
public class App {
public static void main(String[] args) {
FileInputStream in = null;
try {
in = new FileInputStream("theFileIsNotExist.txt");
int b;
b = in.read();
while (b != -1) {
System.out.print((char) b);
b = in.read();
}
} catch (FileNotFoundException e) { // 小范围的Exception在前面
e.printStackTrace(); // 打印堆栈信息
} catch (IOException e) {
System.out.println(e.getMessage());
} finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
App9_IOException
最新推荐文章于 2021-05-26 04:11:20 发布