ICloneable

Interface to create objects with binary clones.

Description

The ICloneable interface allows you to create objects with binary clones.

Instance methods

clone

Creates a binary clone of this object.

Object clone()

  • returns: Object - clone of this object.

Examples

{
   public class MyClass implements IMyClass, ICloneable {
     MyClass() { };
 
     public Object clone() {
       Object cloneObj = new Object (this);
 
       // Copy every attribute from this to cloneObj here.
       ...
 
       return cloneObj;
     }
   }
   }