简体   繁体   English

HashMap和Serializable问题

[英]HashMap and issue with Serializable

when i try to call function which return : List<Map.Entry<Integer, List<Object>>> I get this error : 当我尝试调用返回的函数时: List<Map.Entry<Integer, List<Object>>>我收到此错误:

java.io.NotSerializableException: java.util.HashMap$Node java.io.NotSerializableException:java.util.HashMap $ Node

Note : All class implements Serializable 注意:所有类都实现Serializable

HasMap itself is serializable but Map.Entry isn't. HasMap本身是可序列化的,但Map.Entry不是。 You need to use some other type. 您需要使用其他类型。

For curious there is explanation why, 出于好奇, 解释为什么,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM