• Post Reply Bookmark Topic Watch Topic
  • New Topic

Interface Serialization and Object extensions

 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a general question on serialization and objects which implement an Interface that extends the Seriazable Interface.

If I create an Interface myInt that extends Serializable and then implement the myInt interface with aClass, will the aClass also follow the basic serialization protocol or would it need to implement the Serializable interface as well?

Thanks,

Graham
 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry.

Actually. I have IOne that implements Serializable. And ITwo that extends IOne. Is ITwo also Serializable.

Thanks.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Serializable interface is inherited, so you don't need to "implement" it again. This is also easy to check:
By the way, I hope your interfaces as classes don't start with lowercase letters!
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just saw you second post. Second verse, same as the first
Again, when it's easy to test a hyposthesis, do test it!
 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeff! That was easy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!