It's not a secret anymore!*
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "serialization question" Watch "serialization question" New topic

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.

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

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
Got it.
Thanks a lot.
I agree. Here's the link:
subject: serialization question
Similar Threads
Questions from K&B 6
Related to Object Serialization
how FileOutputStream and ObjectOutputStream working here