1. import java.io.*;
2. public class Foo implements Serializable
{
3. public int x,y;
4. public Foo(int x,int y){this.x=x;this.y=y;}
6. private void writeObject(ObjectOutputStream s)
7. throws IOException{
8. s.writeInt(x);s.writeInt(y);
}
11. private void readObject(ObjectInputStream s)
12. throws IOException,ClassNotFoundException{
14. //insert code here }
}A.s.defaultReadObject();
B.this=s.defaultReadObject();
C.y=s.readInt(); x=s.readInt();
D.x=s.readInt();y=s.readInt();
2. public class Foo implements Serializable
{
3. public int x,y;
4. public Foo(int x,int y){this.x=x;this.y=y;}
6. private void writeObject(ObjectOutputStream s)
7. throws IOException{
8. s.writeInt(x);s.writeInt(y);
}
11. private void readObject(ObjectInputStream s)
12. throws IOException,ClassNotFoundException{
14. //insert code here }
}A.s.defaultReadObject();
B.this=s.defaultReadObject();
C.y=s.readInt(); x=s.readInt();
D.x=s.readInt();y=s.readInt();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货