使欄位類型成為可序列化。
public static final class SomeType implements Serializable {}
public class SerializableField() implements Serializable {
public SerializableField( String str ) {
super();
this .str = str;
nonser = new SomeType();
}
private String str;
private SomeType nonser;
private static final long serialVersionUID = 123;
}
|
|