在下列程序的空白处,应填入的正确选项是______。
Import java. io. * ;
Pulilc class ObjectStreamTest
Publilc static void main(string args[]) throws IOException
ObjectOutputStream oos=new ObjectOutputStream
(new FileOutputStream("serial. bin"));
Java. util. Date d=new Java. util. Date();
Oos______(d);
ObjectlnputStream ois=
new ObjectInputStream(new FileOutputStream("serial. bin"));
try
java. util. date restoredDate=
(Java. util. Date)ois. readObject();
System. out. println
("read object back from serial. bin file:"
+restoredDate);
Catch(ClassNotFoundException cnf)
System. out. println("class not found");
A.WriterObject
B.Writer
C.BufferedWriter
D.writerObject
参考答案:D
解析: 本题考查的是输入/输出及文件操作,writerObjeel方法是向数据流中写入数据。