Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

serialization question  RSS feed

 
William Yan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bing Qiao
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
^O^
Got it.
Thanks a lot.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!