file里的路径

实例话file类的对象

File file=new File("d:/mydoc/hello.txt")

文件名:fileMethod.java

相对路径:fileMethod.java   file.getPath();

绝对路径:D:\ddd\xxxx\fileMethod.java   file.getAbsolutePath();

 

相对路径也可以是绝对路径。它是根据File("d:/mydco.....")决定的 所以也可以是绝对路径:D:/ddd/xxxx/fileMethod.java

posted on 2015-05-14 21:46  JesseCary  阅读(245)  评论(0编辑  收藏  举报

导航