...
The Java API for the clone()
method [API 2011] says:
By convention, the returned object should be obtained by calling
super.clone
. If a class and all of its superclasses (exceptObject
) obey this convention, it will be the case thatx.clone().getClass() == x.getClass()
.
...
Failing to call super.clone()
may result in a cloned object having the wrong type, with resulting unexpected or incorrect results when it is used.
Bibliography
...