<分区>
我有以下要保存在文件中的类定义,它的所有字段都是可序列化的,那么为什么类不能序列化?
我在其他回复中读到我不需要 getter 和 setter,所以我从类定义中省略了它们。
private class MyClass implements Serializable
{
private static final long serialVersionUID = 314L;
public HashMap<Long, String> allTags = new HashMap<Long, String>();
public HashMap<String, String> notes = new HashMap<String, String>();
public HashMap<String, ArrayList<Long>> tags =
new HashMap<String, ArrayList<Long>>();
}