问答详情
源自:6-2 transient及ArrayList源码分析

obj系列化问题

运行objiec的序列化会出现一下异常

Exception in thread "main" java.io.InvalidClassException: mukeProject_4.Student; local class incompatible: stream classdesc serialVersionUID = 1508134281044330490, local class serialVersionUID = 8727940698415832477
    at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
    at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at mukeProject_4.ObjectSerializable.main(ObjectSerializable.java:22)

提问者:小强叔叔3514711 2016-09-20 16:17

个回答

  • XhstormR
    2016-09-25 07:10:59

    解决了吗???

  • 汉江怪人
    2016-09-22 23:23:55

    楼上说的对!

  • 浪天涯
    2016-09-22 14:55:16

    UID不同造成的