我已经能够使用Serializable接口保存在文本文件中,但是当我实现了与DDBB的连接时,因此,使用Conexion类型的fo数据,它不会让我将其写在文件上,因为它似乎不能序列化,但是整个类已经可以序列化了。我真的在这里迷路了。不是提供java.io.NotSerializableException的类,而是提供可序列化的类的属性。
private static final long serialVersionUID = 14728980251747878L;
protected ArrayList<Arma> Armas;
protected ArrayList<Cliente> Clientes;
private Connection conexion; //this is the one who wont let me save
答案 0 :(得分:0)
扩展连接类并创建一个新类,例如SerializableConnection扩展Connection实现了可序列化。