title: Clone Serializable Object - JAVA
body: <p>I am learning <a href="http://grepcode.com/file/repo1.maven.org/maven2/commons-lang/commons-lang/2.1/org/apache/commons/lang/SerializationUtils.java#SerializationUtils.clone%28java.io.Serializable%29" rel="nofollow">how to clone serializable object</a>. When I see the code I got confused that why we need to first <code>serialize</code> the <code>object</code> and then <code>deserialize</code> it ? Is it due to we want to get an <code>Object</code> (or any other reason) ? Then why we just not return the <code>object</code> or <code>serialize</code> object ?</p>
  
  <pre><code>public static Object clone(Serializable object) {
     return deserialize(serialize(object));
  }
  </code></pre>