How do I clone array of vectors? This works only for one vector: Vector vector2 = (Vector)vector.clone(); Thanks!
David Weitzman
Ranch Hand
Joined: Jul 27, 2001
Posts: 1365
posted
0
You could create a vector of vectors instead of and array of vectors, first of all. Or better yet, a list of lists. You could also just make a boring loop: Vector[] copy = new Vector[old.length]; for (int i = 0; i < old.length; old++) { copy[i] = old[i].clone(); }
Dalibor Toth
Ranch Hand
Joined: Jul 16, 2001
Posts: 38
posted
0
Sorry, maybe I wasn't too clear: I have vector v that contains 3 vectors and I need to clone it.