?? countlines.java
字號:
import java.io.*;
public class CountLines {
public static void main(String[] arguments) {
int count = 0;
String verbose = System.getProperty("display.verbose");
try {
FileReader file = new FileReader(arguments[0]);
BufferedReader buff = new BufferedReader(file);
boolean eof = false;
while (!eof) {
String line = buff.readLine();
if (line == null)
eof = true;
else {
count++;
if (verbose != null)
if (verbose.equals("true"))
System.out.println(line);
}
}
buff.close();
System.out.println(arguments[0] + " contains " + count
+ " lines");
} catch (IOException e) {
System.out.println("Error -- " + e.toString());
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -