Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 2:48 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ]  Bookmark and Share
Author Message
 Post subject: serializable and cloneable
PostPosted: Thu May 03, 2007 2:26 pm 
Offline

Joined: Tue May 01, 2007 6:54 pm
Posts: 4
can anyone explain about where to use serializable and cloneable. For what purpose a class should extend the above two.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 09, 2007 12:16 pm 
Offline

Joined: Wed May 09, 2007 10:51 am
Posts: 6
the Serializable and Cloneable are marker interfaces. All of these marker interfaces do not define methods; instead, they identify a class as having a particular capability.

In the case of Serializable, the interface specifies that if the class is serialized using the serialization I/O classes, then a NotSerializableException will not be thrown (unless the object contains some other class that cannot be serialized). Cloneable similarly indicates that the use of the Object.clone() method for a Cloneable class will not throw a CloneNotSupportedException.

Serializable is just a "marker interface." It doesn't declare any methods. It's just a flag that other methods can check. DataOutputStream.writeObject checks whether the class implements Serializable, and throws and excpetion if it doesn't.

_________________
:)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley