Kroakie on 19/2/2006 at 01:40
Ahh I think I got it. Thanks. I guess this either mean my lecturer was talking out of his ass or I completely misunderstood his meaning.
Moving away from lists, what do I do if I do want to deep copy an arbitary object? Or is that a big no-no too?
mopgoblin on 19/2/2006 at 02:11
Some objects shouldn't be copied - objects of classes that are only supposed to have one instance, and objects representing or controlling access to specific resources, for example. To copy an arbitrary object, I think you call clone(), and it'll throw an exception (the class name is something like CloneNotSupportedException - check the documentation for the exact name) if it's of a type that can't be cloned, or give you a deep copy otherwise.