?? 5-4.txt
字號:
import java.io.*;
public class Try_catch
{
public static void main (String args[]) {
FileInputStream fis=null;
try {
fis=new FileInputStream("c:/filename.txt"); // FileInputStream 方法拋出異常,所以位于try體內(nèi)
}
catch(FileNotFoundException e) //捕獲FileNotFoundException異常
{
System.out.println("catch exception:"+e.getMessage());
}
try{
int c=fis.read(); // 調(diào)用的read()方法拋出異常
}
catch(IOException e) //捕獲IOException異常
{
System.out.println("catch exception:"+e.getMessage());
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -