Is there any way to copy or convert a vector to arraylist in Java?
+12
A:
Yup - just use the constructor which takes a collection as its parameter:
Vector<String> vector = new Vector<String>();
// (... Populate vector here...)
ArrayList<String> list = new ArrayList<String>(vector);
Note that it only does a shallow copy.
Jon Skeet
2010-08-09 12:45:14