Java Search Engine

freerice.com

Wednesday, November 21, 2007


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.

No comments:

Ratings by outbrain