What does super's clone do?
<p>I am reading about <code>clone</code> from <code>Effective Java</code><br>
It says that in <code>clone</code> the first method to be called must be <code>super.clone()</code><br>
In this case, I guess that eventually we would end up calling the <code>clone</code> of <code>java.lang.Object</code> going up the hierarchy chain.<br>
But I thought that object's clone doesn't do anything.<br>
Looking in code I see:<br>
<code>protected native Object clone() throws CloneNotSupportedException;</code> and no implementation.<br>
But from the paragraph it seems that if a class has only primitive fields calling<br>
<code>(ClassX) super.clone()</code> is sufficient for creating a clone.<br>
But how? <code>super.clone</code> is of <code>Object</code>.  </p>
