The code does not compile.
The code runs and no change is made to the file.
The code runs and sets the length of the file to 0.
An exception is thrown because the file is not closed.
The code runs and deletes the file from the file system.
第1题:
A.Stringname=File.getParentName(“file.txt”);
B.Stringname=(newFile(“file.txt”)).getParent();
C.Stringname=(newFile(“file.txt”)).getParentName();
D.Stringname=(newFile(“file.txt”)).getParentFile();
E.Directorydir=(newFile(“file.txt”)).getParentDir();Stringname=dir.getName();
第2题:
??有一台系统为Windows Server 2008的计算机,用户john属于本地组group1,管理员创建了一个文件file.txt,并设置本地组group1对file.txt具有完全控制权限,设置john对file.txt具有拒绝读取权限,最终john对file.txt具有()权限。
A.完全控制
B.读取
C.拒绝读取
D.读取和写入
第3题:
对于如下程序: #include
第4题:
为文件c:/java/example/file.txt建立File对象file1可以采用()语句序列。
第5题:
Which command(s) will result in the smallest sized backup of the text files contained in the /staticFS filesystem?()
第6题:
Which determines if “prefs” is a directory and exists on the file system?()
第7题:
The file “file.txt” exists on the file system and contsins ASCII text. Given: try { File f = new File(“file.txt”); OutputStream out = new FileOutputStream(f, true); } catch (IOException) {} What is the result?()
第8题:
InputStream in=new FileReader(“file.txt”);
InputStream in=new FileInputStream(“file.txt”);
InputStream in=new InputStreamFileReader (“file.txt”, “read”);
FileInputStream in=new FileReader(new File(“file.txt”));
FileInputStream in=new FileInputStream(new File(“file.txt”));
第9题:
If the file exists it will be opened for editing. If the file does not exist an error message will be displayed.
If the file exists it will be opened for editing. If the file does not exist a new file with the name file.out will be created and opened for editing.
If the file exists an error message will be displayed. If the file does not exist a new file with the name file.out will be created and opened for editing.
If the file exists the operator will be asked whether to open the file or overwrite the file. If the file does not exist a new file with the name file.out will be created and opened for editing.
第10题:
FileOutputStream out=new FileOutputStream(“file.txt”,true);
OutputStream out=new FileOutputStream(“file.txt”,“append”);
OutputStream out=new FileOutputStream(“file.txt”);
FileOutputStream out=new FileOutputStream(new file(“file.txt”));
OutputStream out=new FileOutputStream(new File(“file.txt”),true.;
第11题:
OutputStream out= new FileOutputStream (“file.txt”); Out.writeBytes (“ /n”);
OutputStream os= new FileOutputStream (“file.txt”, true); DataOutputStream out = new DataOutputStream(os); out.writeBytes (“ /n”);
OutputStream os= new FileOutputStream (“file.txt”); DataOutputStream out = new DataOutputStream(os); out.writeBytes (“ /n”);
OutputStream os= new OutputStream (“file.txt”, true); DataOutputStream out = new DataOutputStream(os); out.writeBytes (“ /n”);
第12题:
File file 1=new File(“c://java//example//file.txt”)
String path=”c:/java/example/”Filefile1=newFile(path,”oldfile.txt”)
File dir 1=new File(“c://java//example”)Filefile1=newFile(dir1,”oldfile.txt”)
File file 1=new File(“c:/java//example/file.txt”)
第13题:
A.Compilation fails.
B.Nothing is added to the file system.
C.Only a new file is created on the file system.
D.Only a new directory is created on the file system.
E.Both a new file and a new directory are created on the file system.
第14题:
字符串"a://xxk//file.txt"的长度为()。
15
略
第15题:
Which two construct an OutputSream that appends to the file “file.txt”? ()
第16题:
Which of the following commands changes a file characteristic so that it cannot be seen with astandard directory query? ()
第17题:
Which of the following will occur if an operator types the command vi file.out?()
第18题:
Which gets the name of the parent directory file “file.txt”?()
第19题:
String name= File.getParentName(“file.txt”);
String name= (new File(“file.txt”)).getParent();
String name = (new File(“file.txt”)).getParentName();
String name= (new File(“file.txt”)).getParentFile();
Directory dir=(new File (“file.txt”)).getParentDir(); String name= dir.getName();
第20题:
Boolean exists=Directory.exists (“prefs”);
Boolean exists=(new File(“prefs”)).isDir();
Boolean exists=(new Directory(“prefs”)).exists();
Boolean exists=(new File(“prefs”)).isDirectory();
Boolean exists=true; Try{ Directory d = new Directory(“prefs”); } catch (FileNotFoundException e) { exists = false; }
第21题:
第22题:
Line 16 is never executed.
An exception is thrown at runtime.
Line 13 creates a File object named “d”.
Line 14 creates a File object named “f‟.
Line 13 creates a directory named “d” in the file system.
Line 16 creates a directory named “d” and a file “f” within it in the file system.
Line 14 creates a file named f inside of the directory named “d” in the file system.
第23题: