Consider a code:
public class MyDto implements Serializable {
private String myField;
public MyDto (String myField) {
this.myField = myField;
}
}
As I see this code works (I hope), but I have no idea how java serialization/deserialization construct object before it sets fields. Any idea?
About duplication
I have not found any constructor
or immutable
key words in this page. So this question is a bit different. Also this describes difference between json/xml etc not some specific feature to java serialization.