posted 16 years ago
First the Player constructor is invoked, as a superclass constructor, and prints "p".
Then the CardPlayer constructor prints "c".
Then the serialization happens, and during the deserialization, the Player constructor is invoked again (printing "p"), because the Player class is a subclass of CardPlayer, but the Player class is not Serializable, so it is initialized in a standard way.
The CardPlayer constructor doesn't run second time, because it is declared Serializable.
[ December 17, 2007: Message edited by: Serge Petunin ]