Content deleted Content added
removed formatting error |
No edit summary |
||
Line 24:
==Cloning==
The process of actually making another exact replica of the object, instead of just its reference, is called cloning. In most languages, the language or libraries can facilitate some sort of cloning. In Java, the Object class contains the [[Clone (Java method)|clone() method]], which copies the object and returns a reference to that copied object. Since it is in the Object class, all classes defined in Java will have a clone method available to the programmer (although to function correctly it needs to be overridden at each level it is used).
Cloning an object in Java:
|