填空题
下面程序段是从对象流中读取对象,请将程序补充完整。
import java.util. *;
import java.io. *;
public class UnSerializaDate
Dated=null;
UnSerializaDate()
try
FilelnputStream f=new FileInputStream("date.ser");
ObjectInputStream s=new ObjectInputStream(f);
f.close();
catch(Exceptione)
e.printStackTrace();
public static void main(String args[])
public static void main(String args[])
UnSerializaDate a=new UnSerializaDate();
System.out.println("The date read is:"+a.d.toString());
【参考答案】
d=(Date)s.readObject()