title: How is java.io.Serializable the Memento pattern?
body: <p>As we know the memento pattern is without violating encapsulation, capturing and externalize a object's internal state and can be reclaimed later without knowledge of the orginal state.</p>
  
  <p>My question comes here  how <code>java.io.Serializable</code> is coming under this pattern because when ever we are <strong>serializing any private variable</strong> and writing the object state to a file at the same time the private varible's value is open to the world and the encapsulation seems to be failing here.</p>