社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
import java.io.File;
public class DirSize {
public static void main(String[] args) {
File dir = new File("/home/huanyu/Desktop");
String parentPath =dir.getParent();
System.out.println("该目录的上级目录为:"+parentPath);
}
}
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!