• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Serialization  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here it goes.

If we implement Serialize interface, then how many methods can we override.
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

I think you're confusing some concepts. Serializable is an interface, so a class can implement it, which means it needs to have implementations of all the methods declared in the interface. Note that in order to implement Serializable, no methods need to be implemented, because Serializable does not declare any.

The same class can also extend another class, in which case it can override any of the super-classes methods. How many that are depends on the super-class.
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serializable is, what they call, a Marker Interface. Such an Interface does not have any methods that are to be implemented. It simply is a 'Marker' stating that the object is a "Serializable object". The Serialization logic is already known and you do not need to implement that.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!