题目内容:
在下面程序的空白处,应填入的正确选项是 import java.io.*; public class ObjectStreamTest { public static void main(String args[])throws IOExeeption } ObjectoutputStream oos=new ObjectOutputStream(new FileOutputStream("serial.bin")); java.util.Date d=new java.util.Date(); oos. ______(d); ObjectInputStream ois=new ObjecttInputStream(new FileInputStream("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.write
C.BufferedWriter
D.writerObject
参考答案:
答案解析: