Serializable attribute!!! [modified]
-
Is Serializable Attribute's behavior inheritable? i have two classes classA, classB. classA have Serializable attribute applied to it. classB inherits classA i want to serialize classB. do i have to apply serializable attribute to classB as well, or inherting from classA would be enough. thanks.
modified on Sunday, September 7, 2008 9:23 AM
-
Is Serializable Attribute's behavior inheritable? i have two classes classA, classB. classA have Serializable attribute applied to it. classB inherits classA i want to serialize classB. do i have to apply serializable attribute to classB as well, or inherting from classA would be enough. thanks.
modified on Sunday, September 7, 2008 9:23 AM
-
Is Serializable Attribute's behavior inheritable? i have two classes classA, classB. classA have Serializable attribute applied to it. classB inherits classA i want to serialize classB. do i have to apply serializable attribute to classB as well, or inherting from classA would be enough. thanks.
modified on Sunday, September 7, 2008 9:23 AM
The [Serializable] attribute is not inherited because your derived class might have fields that are not serializable. The author of your base class (who made the decision to make ClassA serializable) has no idea what you might add to ClassB. So the decision to make a class serializable (or not) is up to the class's author. Enjoy, Robert C. Cartaino