java获取当前目录及父目录和兄弟目录

来源:互联网 发布:win10下ubuntu安装教程 编辑:程序博客网 时间:2024/06/05 20:52
import java.io.*;public class test{    public static void main(String[] args) {                // get current dirFile file = new File(System.getProperty("user.dir"));// get parent dirString parentPath = file.getParent(); #System.out.println(parentPath);// get brother dirString toolPath = parentPath + "/tool";#System.out.println(toolPath);    }}

原创粉丝点击