问题 单项选择题

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

A.BufferedReader
B.DataInputStream
C.DataOutputStream
D.FileInputStream

答案

参考答案:D

解析: 本题考查java.io包中的字符输入流。Java的输入输出包括字节流、文件流和对象流等,要注意区分不同流使用的不同类。字符类输入流都是抽象类InputStreamReader及其子类FileReader、BufferedReader等。选项A中BufferedReader是把缓冲技术用于字符输入流,提高了字符传送的效率,但它不能处理文件流。选项B中DataInputStream类是用来处理字节流的,实现了DataInput接口,不能处理文件流。选项C中DataOutputStream类实现了DataOutput接口,不能处理文件流。选项D中FileInputStream可对一个磁盘文件涉及的数据进行处理,满足题目要求。

单项选择题
单项选择题

If a mechanical aerator is installed in a fish pool, the water in the pool can be properly aerated. So, since John’s fish pool does not have a mechanical aerator, it must be that his pool is not properly aerated. Without properly aerated water, fish cannot thrive. Therefore, any fish in John’s pool will not thrive.
Which one of the following arguments contains an error of reasoning that is also contained in the argument above

A.If alum is added to pickle brine, brine can replace the water in the pickles. Therefore, since Pauls does not add alum to her pickle brine, the water in the pickles cannot be replaced by brine. Unless their water is replaced with brine, pickles will not stay crisp. Thus, Paula’s pickles will not stay crisp.

B.If pectin is added to jam, the jam will gel. Without a setting agent such as pectin, jam will not gel. So in order to make his jam gel, Harry should add a setting agent such as pectin to the jam.

C.If stored potatoes are not exposed to ethylene, the potatoes will not sprout. Beets do not release ethylene. Therefore, if Sara stores her potatoes together with beets, the potatoes will not sprout.

D.If a carrot patch is covered with mulch in the fall, the carrots can be left in the ground until spring. Without a mulch cover, carrots stored in the ground can suffer frost damage. Thus, since Kevin covers his carrot patch with mulch in the fall, the carrots can safely be left in the ground.

E.(E) If tomatoes are not stored in a dark place, their seeds sometimes sprout. Sprouted seeds can make tomatoes inedible. Therefore, since Maria does not store her tomatoes in a dark place, some of Maria’s tomatoes could be inedible.