How to write path to go one level up and then down into another directory

前端 未结 2 1222
醉话见心
醉话见心 2021-02-12 22:20

I\'m trying to open a file in a Java program (say Program.java) using relative path.

I have two directories as follows:

Project         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-12 22:30

    String path="firstpath" +File.separator +".." +File.separator +"secondpath";
    

提交回复
热议问题