This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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


Win a copy of Head First Android this week in the Android forum!
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
Sheriff

Joined: Oct 14, 2005
Posts: 19693
    
  10

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
 
 
subject: inner class serialisation
 
jQuery in Action, 3rd edition