• 2021-04-14 问题

    (对象的序列化)在下列程序的空白处,应填入的正确选项是________。import java. io.*;public class ObjectStreamTest{ public 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); ObjectInputStream ois = new ObjectInputStream (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); } }}

    (对象的序列化)在下列程序的空白处,应填入的正确选项是________。import java. io.*;public class ObjectStreamTest{ public 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); ObjectInputStream ois = new ObjectInputStream (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); } }}

  • 1