Which determines if “prefs” is a directory and exists on the file system?()
- A、 Boolean exists=Directory.exists (“prefs”);
- B、 Boolean exists=(new File(“prefs”)).isDir();
- C、 Boolean exists=(new Directory(“prefs”)).exists();
- D、 Boolean exists=(new File(“prefs”)).isDirectory();
- E、 Boolean exists=true; Try{ Directory d = new Directory(“prefs”); } catch (FileNotFoundException e) { exists = false; }
正确答案:D
答案解析:有
微信扫一扫手机做题