?? listjava.java
字號:
import java.io.*;
public class ListJava extends Object
{
public static void main(String[] args)
{
// Create a File instance for the current directory
File currDir = new File(".");
// Get a filtered list of the .java files in the current directory
String[] javaFiles = currDir.list(new JavaFilter());
// Print out the contents of the javaFiles array
for (int i=0; i < javaFiles.length; i++) {
System.out.println(javaFiles[i]);
}
}
}
// This class implements a filename filter that only allows
// files that end with .java
class JavaFilter extends Object implements FilenameFilter
{
public JavaFilter()
{
}
public boolean accept(File dir, String name)
{
// Only return true for accept if the file ends with .java
return name.endsWith(".class");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -