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”));
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.File myFile; myFile=new File("mulu/file");B.File myFile=new File();C.myFile=new FileC/mulu","filel");D.File myDir=new file("/mulu"); myFile=new File(Dir, "filer');
阅读下面程序import java.io.*;public class ByteStream Test{public static void main(String[] a){int[] myArray = {10,20.30,40};try{DataOutputStream dos = new DataOutputStream(new _________________( " ints.dat " ));for (int i=0;imyArray.length;i++)dos.writeInt(myArray[i] ) ;dos.close();S ystem.out.println( " Have written binary file ints.dat " );}catch (IOException ioc){System.out.println( " IO Exception " );}}}为保证程序正确运行,在程序中下划线处应填入的代码是A)FileOutputStreamB)ByteArrayOutputStreamC)BufferedOutputStreamD)FileWriter
下列InputStream构造方法正确的是()。 A、InputStream in=new FileReader(“file.txt”)B、InputStream in=new FileInputStream(“file.txt”)C、InputStream in=new InputStreamFileReader (“file.txt”,“read”)D、FileInputStream in=new FileReader(new File(“file.txt”))
Given that the current directory is empty, and that the user has read and write privileges to the current, and the following:Which statement is true?() 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.
阅读下面写文件的程序 import java. io. *; public class WriteFile{ public static void main(String[]A) { int[]myArray={10,20,30,40}; try{ FileOutputStream f=new FlieOutStream("ints. dat"); DataOutputStream______=new DataOutputStream(f); for(int i=0; i<myArray. length; i ++) dos. writeInt(myArray[i]); dos. close(); System. out. prinfln("Have written binary file ints. dat"); } catch(IOException ioe){ System. out. println("IO Exception"); } } 在程序下画线处填入的正确选项是A.myArrayB.dosC.ioeD.ints
What command would an operator use to move a file from the /old_dir directory to the /new_dir directory without changing the file name?() A. mv /old_dir/file /new_dirB. mv -p /old_dir/file /new_dirC. mv -k /old_dir/file /new_dirD. mv /old_dir/file /new_dir/new_file
( 20 ) 下列程序的功能是将一个整数数组写入二进制文件 。 在程序的下划线处应填入的选项是import java.io.*;public class XieShuzu{public static void main(String[] a){int [] myArray={10,20,30,40};try{DataOutputStream dos=new DataOutputStream(new FileOutputStream( " ints.dat " ));for(int i=0;imyArray.lenth;i++)dos. _______(myArray[i]);dos.close();System.out.println( " 已 经 将 整 数 数 组 写 入 二 进 制 文 件 :ints.dat " );}catch(IOException ioe){System.out.println( " IO Exception " );}}}A ) writeArrayB ) writeByteC ) writeIntD ) writeDouble
欲新建一个电路原理图文件应该执行()操作。A、File/New/SchematicB、File/New/PCBC、File/New/SchematicLibraryD、File/New/PCBLibrary
创建一个向文件“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.;
在J2EE中,在提供名为sock的套节字实例的前提下,为了获取通过套节字进行通信的输出流,你可以编写()。 A、sock.accept();B、sock.getDataOutputStream*();C、sock.getOutputSteam();D、new DataOutputStream(sock);
在J2EE中,在提供名为sock的套接字实例的前提下,为了获取通过套接字进行通信的输出流,你可以编写()。 A、sock.accept();B、sock.getDataOutputStream();C、sock.getOutputStream();D、new DataOutputStream(sock);
在J2EE中,在提供名为sock的套接字实例的前提下,为了后去通过套接字进行通信的输出流,你可以编写() A、sock.accept()B、sock.getDataOutputStreamC、sock.getOutputStreamD、new DataOutputStream(sock)
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);
Which constructs a DataOutputStream?() A、 New dataInputStream(“in.txt”);B、 New dataInputStream(new file(“in.txt”));C、 New dataInputStream(new writer(“in.txt”));D、 New dataInputStream(new FileWriter(“in.txt”));E、 New dataInputStream(new InputStream(“in.txt”));F、 New dataInputStream(new FileInputStream(“in.txt”));
Which constructs a BufferedIputStream?()A、 New BufferedInputStream(“in.txt”);B、 New BufferedInputStream(new File(“in.txt”));C、 New BufferedInputStream(Writer(“in.txt”));D、 New BufferedInputStream(new Writer(“in.txt”));E、 New BufferedInputStream(new InputStream(“in.txt”));F、 New BufferedInputStream(new FileInputStream(“in.txt”));
A company is deploying a new file server to consolidate shares from several legacy servers. Which of the following is the BEST method to ensure that the new file shares are being used?()A、 Setup the new file server and shut down the legacy servers.B、 Remove all the DNS entries for the legacy servers.C、 Create a logon script to remap the old file shares to the new file shares.D、 Go to each users computer, remove all shares and setup the new shares.
Which two create an InputStream and open file the “file.txt” for reading? ()A、 InputStream in=new FileReader(“file.txt”);B、 InputStream in=new FileInputStream(“file.txt”);C、 InputStream in=new InputStreamFileReader (“file.txt”, “read”);D、 FileInputStream in=new FileReader(new File(“file.txt”));E、 FileInputStream in=new FileInputStream(new File(“file.txt”));
Which method implementations will write the given string to a file named "file", using UTF8 encoding?() IMPLEMENTATION a: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.write(msg); fw.close(); } IMPLEMENTATION b: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("file"), "UTF8"); osw.write(msg); osw.close(); } IMPLEMENTATION c: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.setEncoding("UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION d: public void write(String msg) throws IOException { FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION e: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new OutputStream(new File("file")), "UTF8" ); osw.write(msg); osw.close(); } A、Implementation a.B、Implementation b.C、Implementation c.D、Implementation d.E、Implementation e.
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 BufferedIputStream?()A New BufferedInputStream(“in.txt”);B New BufferedInputStream(new File(“in.txt”));C New BufferedInputStream(Writer(“in.txt”));D New BufferedInputStream(new Writer(“in.txt”));E New BufferedInputStream(new InputStream(“in.txt”));F New BufferedInputStream(new FileInputStream(“in.txt”));
单选题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”));
单选题在下列程序的空白处,应填入的正确选项是( )。import java.io.*;public class writeInt{public static void main(String[] args){int[] myArray={10,20,30,40};try{ DataOutputStream dos=new DataOutputStream(new FileOutputStream("ints.dat")); for(int i=0;i dos.writeInt(myArray[i]); dos.close(); System.out.println("Have written binary file ints.dat");}}catch(IOException ioe){ System.out.println("IOException");}}}Astart()Bclose()Cread()Dwrite()
单选题Which method implementations will write the given string to a file named "file", using UTF8 encoding?() IMPLEMENTATION a: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.write(msg); fw.close(); } IMPLEMENTATION b: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("file"), "UTF8"); osw.write(msg); osw.close(); } IMPLEMENTATION c: public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file")); fw.setEncoding("UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION d: public void write(String msg) throws IOException { FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8"); fw.write(msg); fw.close(); } IMPLEMENTATION e: public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new OutputStream(new File("file")), "UTF8" ); osw.write(msg); osw.close(); }AImplementation a.BImplementation b.CImplementation c.DImplementation d.EImplementation e.
多选题Which two create an InputStream and open file the “file.txt” for reading? ()AInputStream in=new FileReader(“file.txt”);BInputStream in=new FileInputStream(“file.txt”);CInputStream in=new InputStreamFileReader (“file.txt”, “read”);DFileInputStream in=new FileReader(new File(“file.txt”));EFileInputStream in=new FileInputStream(new File(“file.txt”));
单选题Which constructs a DataOutputStream?()A New dataInputStream(“in.txt”);B New dataInputStream(new file(“in.txt”));C New dataInputStream(new writer(“in.txt”));D New dataInputStream(new FileWriter(“in.txt”));E New dataInputStream(new InputStream(“in.txt”));F New dataInputStream(new FileInputStream(“in.txt”));
多选题创建一个向文件“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);