java得到當前文件路徑

  第一種:  File f = new File(this.getClass().getResource("/").getPath());  System.out.println(f);  結果:  C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin  獲取當前類的所在工程路徑;  若是不加「/」  File
相關文章
相關標籤/搜索