p. 432 in the middle of the page: [Animal [name=null, age=0, type=P], Animal [name=null, age=0, type=P]]
This is the output I get if "this.type = 'Q';" is present in the constructor "Animal()" and if "this.type = type;" is also present in the constructor "Animal(String name, int age, char type)"
but, char type is static in the class "Animal", both statements strictly speaking should not be present in the constructors.
If I comment out both statements, "type=P" in the output is now "type=C", which is correct because as the static field "type" is not serialized, the value of "type" is not present in the returned object from the deserialization but comes from a new instanciation of the class.
My question is: since the field "type" is not serialized, where does the value 'P' come from then?
Please, excuse my low level of English.
Thanks in advance for your answer. Claude Lepère
He was expelled for perverse baking experiments. This tiny ad is a model student:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop