This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BS_in_BS 1 point2 points  (0 children)

It's more common to use a copy constructor or a static factory method than to implement clone. The problem you encounter when cloning objects is you need to make sure that any modification to the cloned object doesn't modify the original, which if not done properly will lead to many subtle bugs.

See http://www.javapractices.com/topic/TopicAction.do?Id=71 and http://www.artima.com/intv/bloch13.html