title: Inserting an element in vector changes all other elements
body: <p>I tried to insert a new element in a vector which already has 2. When I write <code>insertElementAt(pers,1)</code>, all the other elements in the vector become the one I just inserted. I even tried using <code>addElement</code> and it also changed the others that were already in the vector.</p>
  
  <pre><code>Vector &lt;Personne&gt; Vect = new &lt;Personne&gt; Vector(); { 
  Personne pers = new Personne(); {
  
  for(int i=0; i&lt;2; i++) {
  
          Vect.addElement(pers);
  
          System.out.println("Entrez le nom de la personne: ");
          pers.setNom(sc.next());
  
          System.out.println("Entrez le sexe de la personne (M/F): ");
          pers.setSexe(sc.next().charAt(0));
  
          System.out.println("Entrez le poid de la personne: ");
          pers.setPoids(sc.nextDouble());
  
          System.out.println("Entrez la taille de la personne: ");
          pers.setTaille(sc.nextDouble());
      }   
  
  System.out.println("Il y a " +Vect.size()+ " personnes dans le vecteur"+"\r\n");
  int j = 1;
  
  for(int i =0; i&lt;2; i++) {
  
      System.out.println("Personne "+j);
      System.out.println("Nom: "+Vect.elementAt(i).getNom());
      System.out.println("Sexe: "+Vect.elementAt(i).getSexe());
      System.out.println("Poids: "+Vect.elementAt(i).getPoids());
      System.out.println("Taille: "+Vect.elementAt(i).getTaille());
      System.out.println();
      j++;
  }
  
  Vect.insertElementAt(pers, 1);
  
  System.out.println("Entrez le nom de la personne: ");
  pers.setNom(sc.next());
  
  System.out.println("Entrez le sexe de la personne (M/F): ");
  pers.setSexe(sc.next().charAt(0));
  
  
  System.out.println("Entrez le poid de la personne: ");
  pers.setPoids(sc.nextDouble());
  
  System.out.println("Entrez la taille de la personne: ");
  pers.setTaille(sc.nextDouble());
  
  System.out.println("Ajout d'une personne a l'indice 2...");
  </code></pre>