我正在上学的实验室,我被困......我的指示告诉我要做以下事情:
我遇到的问题是第二部分如何序列化ListVsSetDemo的实例?
这是我的代码
package labSerialization;
import java.awt.Color;
public class LabSerialization{
public static void main(String[] args) {
ListVsSetDemo demo = new ListVsSetDemo(
new ColoredSquare(4, Color.RED),
new ColoredSquare(6, Color.BLUE),
new ColoredSquare(4, Color.RED),
new ColoredSquare(8, Color.YELLOW));
//testDemo(demo);
serialize(demo, Demo.ser);
};
private static void testDemo(ListVsSetDemo demo) {
System.out.println("List:");
System.out.println(demo.getListElements());
System.out.println("Set:");
System.out.println(demo.getSetElements());
}
private static void serialize(ListVsSetDemo demo, String fileName){
}
}