Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

JAVA Question.

Q.) What happens to the static fields of a class during serialization?
[70 byte] By [radhika743] at [2007-11-11 10:15:58]
# 1 Re: JAVA Question.
They have locks which allow only one thread to have "control" of the field at any one time ... is that what you're looking for?
nspils at 2007-11-11 22:31:42 >
# 2 Re: JAVA Question.
serialization process will not handle, i mean it will not persist the state, for the following cases.
1. static data members. Since static field is not specific to any Object.(Remember we are persisting the instance of a class)
2. Data members of Base class if the base class is not Serializable.
3. Transient data members in the Class.
Hope this clarifies..
sudheerprem at 2007-11-11 22:32:42 >