• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inheritance and Serialization

 
harshada patil
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If super-class is not serializable but subclass is serializable
1. The super class must have no argument constructor accessible to subclass.
2. This constructor will be used to initialize subclass' sub-object.


please explain above statement.
 
Rob Spoor
Sheriff
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this code. After that remove the first constructor of SuperClass and try again.
 
harshada patil
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanks rob for your solution... Now i got the point....
 
Rob Spoor
Sheriff
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic