网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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 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”));” 相关考题
考题 在J2EE中,某一java程序中有如下代码:DataInputStream din=new DataInputStream(new BufferedInputStream(new FileInputStream("employee.dat")));System.out.print(din.readByte());假设在employee.dat文件中只有如下一段字符:abcdefg。则:System.out在屏幕上打印()。A.aB.bC.97D.98

考题 下面创建一个新文件对象方法错误的是( )。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');

考题 下列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.

考题 请完成下列Java程序:实现打印出自己的源文件的功能。注意:请勿改动main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。import java.io.*;import java.util.StringTokenizer;public class ex27_2{public static void main(String args[])throws IOException{FileInputStream fis=new FileInputStream("ex27_2.java");DataInputStream dis=new DataInputStream(fis);String str=null;while(true){__________________;if(str==null){__________________;}StringTokenizer st=new StringTokenizer(str);while(st.hasMoreTokens()){System.out.print(st.nextToken()+ " " );}System.out.println();}}}

考题 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

考题 欲新建一个电路原理图文件应该执行()操作。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中,下面代码中,()不会编译错误。    A、File f = new File("/","autoexec.bat");B、DataInputStream din = new DataInputStream(new FileInputStream("autoexec.bat"));C、InputStreamReader in = new InputStreamReader(System.in);D、OutputStreamWriter out = new OutputStreamWriter(System.in);

考题 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 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 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 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;  }

考题 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”));

考题 单选题在j2ee中,某一Java程序中有如下代码:  DataInputStream din =new DataInputStream(new BufferedInputStream(new FileInputStream("employee.dat"))); System.out.print(din.readByte());  假设在employee.dat文件中只有如下一段字符:abcdefg.则:System.out在屏幕上打印()A  aB  bC 97D 98

考题 单选题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.

考题 多选题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.;

考题 单选题Given that the current directory is empty, and that the user has read and write privileges to the current directory, 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.

考题 多选题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);

考题 多选题在J2EE中,下面代码中,()不会编译错误。AFile f = new File(/,autoexec.bat);BDataInputStream din = new DataInputStream(new FileInputStream(autoexec.bat));CInputStreamReader in = new InputStreamReader(System.in);DOutputStreamWriter out = new OutputStreamWriter(System.in);