oos.writeObject(twst);
oos.writeObject(twst); //问题:我已经在 TestWithStaticTransiantAdd类中定义了
//1:public void writeObject(ObjectOutputStream oos) throws IOException {}
//2: public void readObject(ObjectInputStream ois) throws ClassNotFoundException,IOException {}
// 请问为什么ObjectOutputStream 没有执行呢??????而还是默认执行了defaultWriteObject,defaultReadObject呢??? 你调用的明明是 writeObject(TestWithStaticTransiantAdd );
而不是你写的 writeObject(ObjectOutputStream);你难道没注意到吗?? 他们有何关系??? 参数不一样啊!
oos.writeObject(twst); //问题:我已经在 TestWithStaticTransiantAdd类中定义了
//1:public void writeObject(ObjectOutputStream oos) throws IOException {}
//2: public void readObject(ObjectInputStream ois) throws ClassNotFoundException,IOException {}
// 请问为什么ObjectOutputStream 没有执行呢??????而还是默认执行了defaultWriteObject,defaultReadObject呢??? 你调用的明明是 writeObject(TestWithStaticTransiantAdd );
而不是你写的 writeObject(ObjectOutputStream);你难道没注意到吗?? 他们有何关系??? 参数不一样啊!
//1:public void writeObject(ObjectOutputStream oos) throws IOException {}
//2: public void readObject(ObjectInputStream ois) throws ClassNotFoundException,IOException {}
两个方法,应该是由ObjectOutputStream,ObjectInputStream调用它们,而不是调用默认的defaultWriteObject,defaultReadObject??对于java2000_net您所说的,确实是这样,但是改过来之后运行客户端就会报错,我不知道怎么改...??