This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes serialization question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "serialization question" Watch "serialization question" New topic
Author

serialization question

William Yan
Ranch Hand

Joined: Sep 26, 2006
Posts: 69
Hi ranchers,
I saw this in a K&B exam.

The output is 'pcp'.
I don't know why the 2nd 'p' is printed.
Thankyou.


Java is better and better, yet bitter and bitter.
Bing Qiao
Greenhorn

Joined: Oct 24, 2006
Posts: 21
The base class doesn't implement Serializable Interface which means the constructor of the base class will be called during the deserialization of the subclass.
William Yan
Ranch Hand

Joined: Sep 26, 2006
Posts: 69
^O^
Got it.
Thanks a lot.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: serialization question