title: Whats the purpose of Vector capacity
body: <p>The Vector API defines 4 different constructors:</p>
  
  <pre><code>Vector()
  
  Vector(Collection&lt;? extends E&gt; c)
  
  Vector(int initialCapacity)
  
  Vector(int initialCapacity, int capacityIncrement)
  </code></pre>
  
  <p>but how do they work and what are they used for? Why should i want to define a fixed capacity for a vector? Even if i set the initial capacity to 100, I can add a 101. item to the vector:</p>
  
  <pre><code>Vector&lt;Object&gt; test = new Vector&lt;Object&gt;(100);
  for (int i = 0; i &lt; 100; i++) {
      test.add(new Object());
  }
  
  test.add(new Object());
  System.out.println(test.size());
  System.out.println(test.capacity());
  </code></pre>
  
  <p>In the above code, the second sysout (test.capacity()) writes 200. Why is the capacity in this vector 200? The initial capacity is 100 and i didn't defined a capacity increment.</p>
  
  <p>I really wonder if theres any real world example where these constrcutors are used?</p>
  
  <p>And a smiliar question:
  whats exactly the difference between Vector.get(int position) and Vector.elementAt(int position)? I read that the method get was defined before Vector was added to the Collection class and so it was necessary to add the method elementAt(int position) later too. Is that true? Or are there any other differences?</p>