【发布时间】:2013-06-12 03:17:47
【问题描述】:
我在 Java 中有以下课程。我希望能够将其保存为能够在不同电脑上移动的通用文件格式。我知道对象序列化,但我想知道我的其他选择是什么,它们各自的优缺点是什么。谢谢!例如,序列化文件不是人类可读的,因此是一个骗局。
public class NervousSystem {
private CentralNervousSystem CNS;
private PeripheralNervousSystem PNS;
public NervousSystem(Neocortex neocortex, LateralGeniculateNucleus LGN, Retina retina) {
this.CNS = new CentralNervousSystem(neocortex, LGN);
this.PNS = new PeripheralNervousSystem(retina);
}
public CentralNervousSystem getCNS() {
return this.CNS;
}
public PeripheralNervousSystem getPNS() {
return this.PNS;
}
}
【问题讨论】:
标签: java serialization file-io save