It is simple, the class will not be serializable, unless the field is declared transient (which will prevent the field from being serialized, i.e. it will not be saved).
It'll throw a NotSerializableException when you try to serialize it. To avoid that, make that field a "transient" field.
private transient YourNonSerializableObject dontSerializeMe; // This won't be serialized
It'll throw a NotSerializableException when you try to serialize it. To avoid that, make that field a "transient" field.
private transient YourNonSerializableObject dontSerializeMe; // This won't be serialized
Comments
Post a Comment