Which constructs a DataOutputStream?()
第1题:
请完成下列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();
}
}
}
第2题:
欲新建一个电路原理图文件应该执行()操作。
第3题:
在J2EE中,下面代码中,()不会编译错误。
第4题:
Which constructs a BufferedIputStream?()
第5题:
Which two create an InputStream and open file the “file.txt” for reading? ()
第6题:
Which determines if “prefs” is a directory and exists on the file system?()
第7题:
What writes the text “ ” to the end of the file “file.txt”?()
第8题:
New dataOutputStream(“out.txt”);
New dataOutputStream(new file(“out.txt”));
New dataOutputStream(new writer(“out.txt”));
New dataOutputStream(new FileWriter(“out.txt”));
New dataOutputStream(new OutputStream(“out.txt”));
New dataOutputStream(new FileOutputStream(“out.txt”));
第9题:
Implementation a.
Implementation b.
Implementation c.
Implementation d.
Implementation e.
第10题:
New dataInputStream(“in.txt”);
New dataInputStream(new file(“in.txt”));
New dataInputStream(new writer(“in.txt”));
New dataInputStream(new FileWriter(“in.txt”));
New dataInputStream(new InputStream(“in.txt”));
New dataInputStream(new FileInputStream(“in.txt”));
第11题:
Compilation fails.
Nothing is added to the file system.
Only a new file is created on the file system.
Only a new directory is created on the file system.
Both a new file and a new directory are created on the file system.
第12题:
File f = new File(/,autoexec.bat);
DataInputStream din = new DataInputStream(new FileInputStream(autoexec.bat));
InputStreamReader in = new InputStreamReader(System.in);
OutputStreamWriter out = new OutputStreamWriter(System.in);
第13题:
A. mv /old_dir/file /new_dir
B. mv -p /old_dir/file /new_dir
C. mv -k /old_dir/file /new_dir
D. mv /old_dir/file /new_dir/new_file
第14题:
创建一个向文件“file.txt”追加内容的输出流对象的语句有()。
第15题:
Which two construct an OutputSream that appends to the file “file.txt”? ()
第16题:
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?()
第17题:
Which constructs a DataOutputStream?()
第18题:
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(); }
第19题:
New BufferedInputStream(“in.txt”);
New BufferedInputStream(new File(“in.txt”));
New BufferedInputStream(Writer(“in.txt”));
New BufferedInputStream(new Writer(“in.txt”));
New BufferedInputStream(new InputStream(“in.txt”));
New BufferedInputStream(new FileInputStream(“in.txt”));
第20题:
a
b
97
98
第21题:
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”));
第22题:
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.;
第23题:
OutputStream out=new FileOutputStream(“file.txt”);
OutputStream out=new FileOutputStream(“file.txt”, “append”);
FileOutputStream out=new FileOutputStream(“file.txt”, true);
FileOutputStream out=new FileOutputStream(new file(“file.txt”));
OutputStream out=new FileOutputStream(new File(“file.txt”)true);