title: Copy Vector in a Vector in Java
body: <p>I'd like to copy a vector to another. The problem is that if I change the vector <code>v1</code>, the second vector <code>v2</code> is changing too.  My goal is to keep the copy intact even if I change the source vector.</p>
  
  <pre><code>import java.util.Collections;
  import java.util.Vector;
  
  public class CopyElementsOfVectorToVectorExample {
  
    public static void main(String[] args) {
  
      //create first Vector object
      Vector v1 = new Vector();
  
      //Add elements to Vector
      v1.add("1");
      v1.add("2");
      v1.add("3");
  
      //create another Vector object
      Vector v2 = new Vector(v1.size());  
  
      v2.setSize(v1.size());
      Collections.copy(v2,v1);
  
  
      System.out.println("After copy, Second Vector Contains : " + v2);  
    }}
  </code></pre>
  
  <p>How can I keep the second copy intact?</p>