title: Serializing an object which has a non-serializable parent class
body: <p>How does the below code work? </p>
  
  <pre><code>     class A {
           int a = 10;
       }
  
  
       class B extends A implements Serializable{
  
        }
  
  
  
       public class Test {
         public static void main(String[] args){
          B obj = new B();
          obj.a = 25;
  
  
          //Code to serialize object B  (B b= new B()),
           // deserialize it and print the value of 'a'. 
        }
      }
  </code></pre>
  
  <p>The code prints 10 even though I have changed the value of 'a' in the code.</p>
  
  <p>Any explanation for this behaviour ?</p>