Q
qazmlp1209
public class myClass implements Serializable
{
private int intData ;
private String stringData ;
private myEnum enumData ;
private Collection<someOtherClass> someOtherObjCol ;
// Other parts
static final long serialVersionUID = 1L;
}
My understanding is given below, to make myClass objects eligible for
serialization:
- int, String data are serializable by default. So, nothing
additionally needs to be done for them.
- All enum(introduced in Java 1.5) objects are serializable by
default. So, nothing additionally needs to be done for them.
- someOtherClass should implement the Serializable.
So, to make myClass objects serializable, I should just make
someOtherClass objects to be Serializable.
I assume no other changes are required.
Can anybody confirm this?
{
private int intData ;
private String stringData ;
private myEnum enumData ;
private Collection<someOtherClass> someOtherObjCol ;
// Other parts
static final long serialVersionUID = 1L;
}
My understanding is given below, to make myClass objects eligible for
serialization:
- int, String data are serializable by default. So, nothing
additionally needs to be done for them.
- All enum(introduced in Java 1.5) objects are serializable by
default. So, nothing additionally needs to be done for them.
- someOtherClass should implement the Serializable.
So, to make myClass objects serializable, I should just make
someOtherClass objects to be Serializable.
I assume no other changes are required.
Can anybody confirm this?