Can we serialize the static variables?
No. Since serialization is the process of converting object's state into bytes so that the object can be sent across network or stored to the physical storage media (like hard disk) for later retrieval. Since static variables are not associated with any object (specific instance), they can't be serialized.
So, serialization is associated with objects, static members are associated with class not an object.
Java Search Engine
Wednesday, November 21, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment