This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Externalizable interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Externalizable interface" Watch "Externalizable interface" New topic

Externalizable interface


Joined: Aug 10, 2005
Posts: 29
what is the use of Externalizable interface?

thanks in advace,
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189

Do you understand what Serializable is for? Externalizable is similar, but it gives you complete control over the format of the serialized data for a class -- i.e., you have to save all the data yourself.

[Jess in Action][AskingGoodQuestions]
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
Externalizable is an interface which contains two methods readExternal and writeExternal. These methods give you a control over the serialization mechanism. Thus if your class implements this interface, you can customize the serialization process by implementing these methods.
You can find a sample in here.
I agree. Here's the link:
subject: Externalizable interface
It's not a secret anymore!