题目内容:
在下列程序的空白处,应填入的正确选项是( )。 Import java.io.*;
Pulilc class ObjectStreamTest{
Publilc static void main(string args[])throws IOEx-
ception{
OhiectOutputStream oos=new OhjectOutputStream
(new FileOutputStream("serial.bin"));
Java.util.Date d=new Java.util.Date();
Oos(d);
ObjectInputStream ois=
new OhjectlnputStream(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
参考答案:
答案解析: