📄 testfile.java
字号:
import java.io.*;
public class TestFile
{
public static void main(String[] args)
{
File f = new File("F:\\student.txt");
if(f.exists())
{
f.delete();
}
try
{
f.createNewFile();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
System.out.println(f.getName());
System.out.println(f.getPath());
System.out.println(f.getAbsolutePath());
System.out.println(f.getParent());
System.out.println(f.canRead());
System.out.println(f.lastModified());
System.out.println(f.length());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -