1) A class can be serialized even if its parent class is not. 2) When an instance of a Serializable class is deserialized, the constructor does not run, and instance variables arc not given their initially assigned values. 3) If your class is a serializable class, but your superclass is not serializable, then the non-serializable class constructor will run when the object for child class is getting deserialized. Every constructor above the first non-serializable class constructor will also run, no matter what, because once the first super constructor is invoked, it of course invokes its super constructor and so on up the inheritance tree
For the output: The first 'p' and 'c' in the output are simple - super class constructor and class constructor getting called while object creation of class CardPlayer in: CardPlayer c1 = new CardPlayer();
The last p is because of point 3 stated above.
Joined: Apr 10, 2008
Thanks for explaining the reason.I got the concept.