?? filetest.java
字號(hào):
import java.io.*;
public class FileTest
{
public static void main( String args[] )
{
String fileName = "e:/example.txt";
File f1 = new File( fileName );
File f2=new File("e:/FileTest.txt");
System.out.println("properties of file " + fileName );
System.out.println("getName() : " + f1.getName() );
System.out.println("getPath() : " + f1.getPath() );
System.out.println("getAbsolutePath() : " + f1.getAbsolutePath() );
System.out.println("getParent() : " + f1.getParent() );
System.out.println("exists() : " + f1.exists() );
System.out.println("canRead() : " + f1.canRead() );
System.out.println("canWrite() : " + f1.canWrite() );
System.out.println("length() : " + f1.length() );
System.out.println("isFile() : " + f1.isFile() );
System.out.println("isDirectory() : " + f1.isDirectory() );
System.out.println("renameTo() : " + f1.renameTo(f2) );
System.out.println("new file " + f2.getName() );
System.out.println("lastModified() : " + f1.lastModified() );
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -