两个常用静态变量
| 常量名称 | 常量用途 | 
|---|---|
| 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 */

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号