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);
}
}
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);
}
}