A-A+

在读字符文件emplyee.dat时 使用该文件作为参数的类是()。A.BufferRead

2022-08-05 22:59:12 问答库 阅读 173 次

问题详情

在读字符文件emplyee.dat时,使用该文件作为参数的类是()。
A.BufferReader
B.DataInputStream
C.DataOutputStream
D.FileInputStream请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:D
解析:字节输入流继承自InputSteam类,并且使用DataInputStream实现DataInput接口。编程时的步骤如下:字节数据的来源(二进制文件)作为FileInputStream的构造方法的参数,实例化一个FileInputStream对象;FileInputStream对象作为DataInputStream的构造方法的参数;然后就可以使用InputStream类中的方法,进行字节输入流的操作。

考点:字符,参数