File类
package demo01;
public class Demo01File {
public static void main(String[] args) throws IOException {
//路径分割符
String pathSeparator = File.pathSeparator;
System.out.println(pathSeparator); //win 是分号 ; linux :冒号
//文件分割符
String separator=File.separator;
System.out.println(separator);// win \ linux: / root/home
//绝对路径
//相对路径 ../../
//show01();
//show02("D:\\rxp\\java","test");
//show03();
///
//show04();
//show05();
show06();
show07();
show08();
//show09();
//show10();
show11();
//show12();
}
private static void show12() {
//如果路径不存在,直接返回false
File f1 =new File(“D:\gyq\java1\hello.java”);
boolean b1= f1.delete();//
System.out.println(b1);