系列化的ArrayList的Java [英] serialization ArrayList Java

查看:118
本文介绍了系列化的ArrayList的Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要序列类型的Arrylist 的ArrayList<班级>
和类包含两个arrylist原始类型

I want to serialize the Arrylist of type ArrayList<Class> and the class contains two arrylist of primitive type

public class Keyword {

    private long id;
    private long wid;
    private String name;
    private ArrayList<Integer> rank;
    private int month;
    private float avg;
    private ArrayList<String> date;
        ... and so on
}

如何能做到这一点
请帮我这个...

How can i do that please help me with this...

在此先感谢大量的

推荐答案

如果你想使用串行接口,你应该没有问题,因为ArrayList是序列化的,就像串,每一个基本类型。 公共类关键字实现Serializable {} 应该做的。你可以阅读更多有关此方法这里。但是也有很多的序列化的其他选项。所以,请更具体。

If you want to use Serializable, you should have no problems, because ArrayList is Serializable just as String and every primitive type. public class Keyword implements Serializable {} should do. You can read more about this method here. However there are a lot of other options for serialization. So please be more specific.

这篇关于系列化的ArrayList的Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆