Java: how to clone ArrayList but also clone its items?

Posted by palig on Stack Overflow See other posts from Stack Overflow or by palig
Published on 2009-04-03T20:40:28Z Indexed on 2010/05/19 10:20 UTC
Read the original article Hit count: 215

Filed under:
|

Hello,

How can I clone Array List but also clone its items in Java 1.5?

For example I have:

ArrayList<Dog> dogs = getDogs();
ArrayList<Dog> clonedList = ....something to do with dogs....

And I would expect that objects in clonedList are not the same as in dogs list.

Thanks for any answer!

© Stack Overflow or respective owner

Related posts about java

Related posts about clone