Loading

两个常用静态变量

 

常量名称常量用途
pathSeparator 路径分割符
separator 文件分割符

例:

package cn.hxh.io.file;

import java.io.File;

public class Demo01 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println(File.pathSeparator);
        System.out.println(File.separator);
        String path = "E:" + File.separator + "xp" + File.separator + "1.txt";
        System.out.println(path);
    }

}
/*
;
\
E:\xp\1.txt

*/

 

posted @ 2020-01-25 21:45  shimeath  阅读(102)  评论(0)    收藏  举报