单选题Which determines if “prefs” is a directory and exists on the file system?()ABoolean exists=Directory.exists (“prefs”);BBoolean exists=(new File(“prefs”)).isDir();CBoolean exists=(new Directory(“prefs”)).exists();DBoolean exists=(new File(“prefs”)).isDi

题目
单选题
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;  }


相似考题