September 2019
Intermediate to advanced
816 pages
18h 47m
English
The Object class contains a method named clone(). This method is useful for creating shallow copies (it can be used for deep copies as well). In order to use it, a class should follow the given steps:
The Cloneable interface doesn't contain any methods. It is just a signal for JVM that this object can be cloned. Once this interface is implemented, the code needs to override the Object.clone() method. This is needed because Object.clone() is protected, and, in order to call it via super, the code needs to override this method. ...