wood burning stoves*
The moose likes Beginning Java and the fly likes why serializable interface called as marker interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why serializable interface called as marker interface" Watch "why serializable interface called as marker interface" New topic
Author

why serializable interface called as marker interface

kesava chaitanya
Ranch Hand

Joined: Aug 15, 2001
Posts: 140
hi

when a class implements the interface we will override those methods in the class;But in the case of serializable interface we wont implement(readObject and writeObejct) methods in the particulr class.why?
[ November 08, 2004: Message edited by: kesava chaitanya ]
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
Many serializable objects can use the default versions of readObject() and writeObject() contained in ObjectInputStream and ObjectOutputStream respectively. Only if the default versions can't handle a class does that class have to supply specialized versions of readObject() and writeObject()

Putting these methods in the Serializable interface would not allow any serializable classes to use the default methods.


Mike Gershman
SCJP 1.4, SCWCD in process
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why serializable interface called as marker interface
 
Similar Threads
A doubt about Serializable
serializable interface
Serializable interface.
how to serialize?
Serializable interface