Above code serilize and deserilize a transient variable. comment and uncomment private writeObject and readObject methods and see the output. I hope it will help You.
Transient variables are not Serializable. If transient variable is a primitive and you try to deserialize it, java will initialize the primitive with the default value, for an Object it will be null.