Say, I have a class X
which has a field value, that is,
class X implements Serializable {
private int value;
// ...
}
Further it has getters and setters not displayed here. This class is serialized. At the deserialzation, end same class has value field and access specifier is public. Further, this class does not have getters and setters. So, my questions are:
- Does deserialization fail in case the access specifier of the field changes OR some or all of the methods go missing in the class at the deserialization end?
- What is the mechanism by which fields are assigned their values during deserialization?