By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Static fields and Serialization

P: n/a
I'm trying to understand why static fields are not serializable in
general. Is it purely because of implementation reasons or because it
does not make sense to do this?



Jun 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
antoan <an****@antoan.plus.com> wrote:
I'm trying to understand why static fields are not serializable in
general. Is it purely because of implementation reasons or because it
does not make sense to do this?


Serialization persists the state of a single object. Static fields are
not part of the state of an object - they're effectively the state of
the type.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 27 '06 #2

P: n/a
Jon Skeet [C# MVP] wrote:
antoan <an****@antoan.plus.com> wrote:
I'm trying to understand why static fields are not serializable in
general. Is it purely because of implementation reasons or because it
does not make sense to do this?


Serialization persists the state of a single object. Static fields are
not part of the state of an object - they're effectively the state of
the type.

Thanks Jon, exactly what I was looking for.

A
Jun 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.