I've got a problem...
I want to copy any object.... So that I've got two Objects of the same class...
How can I manage it, without knowing before, which class it is?
if (thisObject isInstanceof Class) { Class newX = new Class(); }
public interface Copy { Copy duplicate(); }
public class Example extends Actor implements Copy { private String ExampleName; [...] public Copy duplicate() { Example Exe = new Example(); Exe.ExampleName = this.ExampleName; [...] return Exe; } }
public Copy getACopyOfTheObject(Copy ObjectToCopy) { return ObjectToCopy.duplicate(); }