Are static variables serialized in Serialization process
<p>I'm stumbled upon understanding java serialization. I have read in many documents and books that static and transient variables cannot be serialized in Java.
 We declare a serialVersionUid as follows.</p>

<pre><code>private static final long serialVersionUID = 1L;
</code></pre>

<p>If a static variable was not serialized then, we often face an exception during the de-serialization process. </p>

<pre><code>java.io.InvalidClassException
</code></pre>

<p>in which the serialVersionUID from the deserialized object is extracted and compared with the serialVersionUID of the loaded class.</p>

<p>To my knowledge i think that if static variables cannot be serialized. There is no point of that exception. I may be wrong because I'm still learning.</p>

<p>Is it a myth that "Static and transient variables in java cannot be serialized". Please correct me, I'm in a mess about this concept.</p>
