第37题:[单选题]Java中下列哪个语句可以获取文件“file.txt”的父目录名称? A.String name = File.getParentName(“file.txt”); B.String name = (new File(“file.txt”)).getParent(); C.String name = (new File(“file.txt”)).getParentName(); D.String name = (new File(“file.txt”)).getParentFile(); 参考答案:D