但是在Forte里面它默认的当前目录是Forte下的一个目录
是不是和Forte设置有关,请多指教

解决方案 »

  1.   

    \test.java 表示根目录下的文件
    test.java表示当前目录的文件。
      

  2.   

    File f = new File("."); //File("othername") to get the other file/dir.
    System.out.println("\n getPath: " + f.getPath());
      

  3.   

    多谢楼上各位兄弟,还是不对,我想可能和Forte有关系。
      

  4.   

    多谢各位,不在Forte里面调试就OK.
      

  5.   

    String  sep=System.getProperty("file.separator");
    得到系统的文件分割符,