📄 test.java
字号:
import java.io.*;
class Foo
{
public Foo (String fileName) throws FileNotFoundException,
IOException
{
FileReader fr = new FileReader(fileName);
BufferedReader br = new BufferedReader(fr);
String str = br.readLine();
//...
}
public void scanfile()
{}
}
class Test
{
public static void main(String args[])
{
Foo somefoo = null;
try {
somefoo = new Foo("temp.fil");
}
catch (FileNotFoundException fnfe) { //Catch constructor
//... //failure
}
catch (IOException ioe) { //Catch constructor failure
//...
}
//Use somefoo
somefoo.scanfile();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -