When you serialize a Beagle object it will be serialized without any compiler error , because the subtypes of a serializable class are themselves serializable. when you deserialize it, then the constructor of Animal class will run because it is not serialized.
Ankit Garg wrote:
But not everyone who is here to help you going to give the SCJP exam, so generally its better for people to put their code in code tags if they want others to read their code and help them...
Yes I know and that is why I said, "I also would appreciate the code tags". I am glad JavaRanch has this feature for postings.