Which constructs a DataOutputStream?()
第1题:
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”))
第2题:
请完成下列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();
}
}
}
第3题:
在J2EE中,某一java程序中有如下代码:DataInputStream din=new DataInputStream(new BufferedInputStream(new FileInputStream("employee.dat")));System.out.print(din.readByte());假设在employee.dat文件中只有如下一段字符:abcdefg。则:System.out在屏幕上打印()。
A.a
B.b
C.97
D.98
第4题:
在J2EE中,下面代码中,()不会编译错误。
第5题:
欲新建一个电路原理图文件应该执行()操作。
第6题:
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.
第7题:
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
第8题:
下面创建一个新文件对象方法错误的是( )。
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');
第9题:
创建一个向文件“file.txt”追加内容的输出流对象的语句有()。
第10题:
Which two construct an OutputSream that appends to the file “file.txt”? ()