问题:[选择题]
A.
int[]myArray=10,20,30,40;
try
FileOutputStreamf=newFileOutputStream("ints.dat");
DataOutputStream______=newDataOutputStream(f);
for(inti=0;i<myArray.length;i++)dos.writeInt(myArray[i]);
dos.close();
System.out.println("Havewrittenbinaryfileints.dat");
catch(IOExceptionioe)
System.out.println("IOException");
程序中下画线处应填入的正确选项是A)myArray
B.dos
C.ioe
D.ints
● 参考解析
本程序中需要将DataOutputStream实例化,由于后边用到了dos.writeInt,由此可看出实例化后的名称为dos。所以下画线处应填写dos。