Cannot Serialize/Deserialize ArrayList

后端 未结 2 956
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 20:11

I\'m trying to serialize and deserialize an array list with a object inside:

HairBirt param = new HairBirt();
param.setName(\"name\");
param.setValue(2.3f);
         


        
2条回答
  •  悲&欢浪女
    2021-01-05 20:33

    Have you tried overriding this behavior by declaring your own serialVersionUID in your custom class?

    Do you have a specific reason for doing the extra step of serializing through a string? Normally you would just deserialize through an ObjectOutputStream.

提交回复
热议问题