I have an ArrayList that I\'d like to return a copy of. ArrayList has a clone method which has the following signature:
ArrayList
I think this should do the trick using the Collections API:
Note: the copy method runs in linear time.
//assume oldList exists and has data in it. List newList = new ArrayList(); Collections.copy(newList, oldList);