How can I serialize an interface?
问题 Suppose I have a Serializable class ShapeHolder that owns an object that implements a Serializable Shape interface. I want to make sure the correct concrete shape object is saved (and the correct type is later restored). How can I accomplish this? interface Shape extends Serializable {} class Circle implements Shape { private static final long serialVersionUID = -1306760703066967345L; } class ShapeHolder implements Serializable { private static final long serialVersionUID =