aspose file tools*
The moose likes Java in General and the fly likes inner class serialisation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "inner class serialisation " Watch "inner class serialisation " New topic
Author

inner class serialisation

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Hi all,

if super class implements serialzable interface all other classes which extends the superclass do not need to imlepment serialzable interface.
what if they do what will happen?

And what I want to know is does this rule applies to inner, ananyomus, nested classes too or not?

Regards,
rahul.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Yes, that rule applies to all classes. (And it applies to all interfaces, not just Serializable.) A nested class is a class so that rule applies to it.

Unless you were thinking that the application of the rule would be "If a class implements an interface then all classes nested in it automatically implement that interface". That is not what the rule says.
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Originally posted by Paul Clapham:
Yes, that rule applies to all classes. (And it applies to all interfaces, not just Serializable.) A nested class is a class so that rule applies to it.

Unless you were thinking that the application of the rule would be "If a class implements an interface then all classes nested in it automatically implement that interface". That is not what the rule says.



i did not get the 2nd para?
[ September 01, 2006: Message edited by: rauhl roy ]
Srinivas Kalvala
Ranch Hand

Joined: Oct 20, 2005
Posts: 257

Hello,

This will help you,

http://java.sun.com/developer/technicalArticles/Programming/serialization/

Or

http://www.deitel.com/articles/java_tutorials/20050923/IntroductionToObjectSerialization.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inner class serialisation