Serialization interface
1 posts in topic
Flat View  Flat View

Posted By:   shailesh_agarwal
Posted On:   Wednesday, July 18, 2001 05:11 AM

How does serialization interface work when it does not have any methods? Is there any functionality hidden behind this interface with no methods? I can not understand the significance of such interfaces. can we design such interfaces in our applications?

Re: Serialization interface

Posted By:   Nils_Kulk  
Posted On:   Wednesday, July 18, 2001 05:24 AM

java.io.Serializable is what is called a "marker" or "tagger" interface. It marks instances of classes that implement it as serializable.

From the javadoc:

Serializability of a class is enabled by the class implementing the
java.io.Serializable interface. Classes that do not implement this
interface will not have any of their state serialized or
deserialized. All subtypes of a serializable class are themselves
serializable. The serialization interface has no methods or fields
and serves only to identify the semantics of being serializable.

About | Sitemap | Contact