在Windows下的路径分隔符和Linux下的路径分隔符是不一样的,当直接使用绝对路径时,跨平台会暴出“No such file or diretory”的异常. 比如说要在temp目录下建立一个test.txt文件,在Windows下应该这么写:File file1 = new File ("C:\tmp\test.txt");在Linux下则是这样的:File file2 = new File ("/tmp/test.txt"); 如果要考虑跨平台,则最好是这么
Property是JAVA中的属性操作类,该类在java.util包中,它是HashTable的子类. 常用函数列表: l Properties() n 构造函数 l setProperty(String key, String value) n 设置属性的key-value l store(OutputStream out, String comments) n 将properties以键值对的方式存储为文本文件 l storeToXML(OutputStream os, Str
1.File类:对硬盘上的文件和目录进行操作的类. File类是文件和目录路径名抽象表现形式 构造函数: 1) File(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname. 2)File(File parent, String child) Creates a new File i