假设文件“a.txt”的长度为100字节,那么当正常运行语句“OutputStream f = new FileOutputStream(new File(“a.txt”));”之后,文件“a.txt”的长度变为0字节。()
假设文件“a.txt”的长度为100字节,那么当正常运行语句“OutputStream f = new FileOutputStream(new File(“a.txt”));”之后,文件“a.txt”的长度变为0字节。()
相关考题:
以下哪个命令可以正确打开文件() A.F=open(r‘c:\windows\a.txt’)B.F=open(‘c:\windows\a.txt’)C.F=open(c:\windows\a.txt)D.F=open(rc:\windows\a.txt)
某文件系统采用多级索引结构,若磁盘块的大小为512字节,每个块号需占3字节,那么根索引采用一级索引时的文件最大长度为(27)K字节;采用二级索引时的文件最大长度为(28)K字节。(54)A.85B.170C.512D.1024
若要将当前盘目录下的文件A.TXT连接在文件B.TXT后面,应使用的命令为( )。A.COPY A.TXT>>B.TXTB.MOVE A.TXT>>B.TXTC.PATH A.TXT>>B.TXTD.TYPE A.TXT>>B.TXT
下列打开文件的表达式中,错误的是( )。A.ofstream ofile;ofile.open("C:\\vc\\a.txt",ios::binary);B.fstream iofile;iofile.open("a.txt",ios::ate);C.ifstream ifile("C:\\vc\\a.txt");D.cout.open("C:\\vc\\s.txt",ios::binary);
假设文件“a.txt”的长度为100字节,那么当正常运行语句“OutputStreamf=newFileOutputStream(newFile(“a.txt”));”之后,文件“a.txt”的长度变为0字节。( )
创建一个向文件“file.txt”追加内容的输出流对象的语句有()。A、FileOutputStream out=new FileOutputStream(“file.txt”,true);B、OutputStream out=new FileOutputStream(“file.txt”,“append”);C、OutputStream out=new FileOutputStream(“file.txt”);D、FileOutputStream out=new FileOutputStream(new file(“file.txt”));E、OutputStream out=new FileOutputStream(new File(“file.txt”),true.;
Which two construct an OutputSream that appends to the file “file.txt”? ()A、 OutputStream out=new FileOutputStream(“file.txt”);B、 OutputStream out=new FileOutputStream(“file.txt”, “append”);C、 FileOutputStream out=new FileOutputStream(“file.txt”, true);D、 FileOutputStream out=new FileOutputStream(new file(“file.txt”));E、 OutputStream out=new FileOutputStream(new File(“file.txt”)true);
在搜索文件/文件夹时,若用户选择通配符?A.txt,则下列被选中的文件是()。 ①A.txt ②A1.txt ③1A.txt ④aA1.txt ⑤aA.txtA、③④⑤B、①③⑤C、①②④D、③⑤
Which constructs a DataOutputStream?()A、 New dataOutputStream(“out.txt”);B、 New dataOutputStream(new file(“out.txt”));C、 New dataOutputStream(new writer(“out.txt”));D、 New dataOutputStream(new FileWriter(“out.txt”));E、 New dataOutputStream(new OutputStream(“out.txt”));F、 New dataOutputStream(new FileOutputStream(“out.txt”));
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?()A、 The code does not compile.B、 The code runs and no change is made to the file.C、 The code runs and sets the length of the file to 0.D、 An exception is thrown because the file is not closed.E、 The code runs and deletes the file from the file system.
What writes the text “ ” to the end of the file “file.txt”?()A、 OutputStream out= new FileOutputStream (“file.txt”); Out.writeBytes (“ /n”);B、 OutputStream os= new FileOutputStream (“file.txt”, true); DataOutputStream out = new DataOutputStream(os); out.writeBytes (“ /n”);C、 OutputStream os= new FileOutputStream (“file.txt”); DataOutputStream out = new DataOutputStream(os); out.writeBytes (“ /n”);D、 OutputStream os= new OutputStream (“file.txt”, true); DataOutputStream out = new DataOutputStream(os); out.writeBytes (“ /n”);
单选题Which constructs a DataOutputStream?()A New dataOutputStream(“out.txt”);B New dataOutputStream(new file(“out.txt”));C New dataOutputStream(new writer(“out.txt”));D New dataOutputStream(new FileWriter(“out.txt”));E New dataOutputStream(new OutputStream(“out.txt”));F New dataOutputStream(new FileOutputStream(“out.txt”));
判断题假设文件“a.txt”的长度为100字节,那么当正常运行语句“OutputStream f = new FileOutputStream(new File(“a.txt”));”之后,文件“a.txt”的长度变为0字节。()A对B错
多选题创建一个向文件“file.txt”追加内容的输出流对象的语句有()。AFileOutputStream out=new FileOutputStream(“file.txt”,true);BOutputStream out=new FileOutputStream(“file.txt”,“append”);COutputStream out=new FileOutputStream(“file.txt”);DFileOutputStream out=new FileOutputStream(new file(“file.txt”));EOutputStream out=new FileOutputStream(new File(“file.txt”),true.;
多选题Which two construct an OutputSream that appends to the file “file.txt”? ()AOutputStream out=new FileOutputStream(“file.txt”);BOutputStream out=new FileOutputStream(“file.txt”, “append”);CFileOutputStream out=new FileOutputStream(“file.txt”, true);DFileOutputStream out=new FileOutputStream(new file(“file.txt”));EOutputStream out=new FileOutputStream(new File(“file.txt”)true);
单选题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?()A The code does not compile.B The code runs and no change is made to the file.C The code runs and sets the length of the file to 0.D An exception is thrown because the file is not closed.E The code runs and deletes the file from the file system.