Eu estava fazendo alguns testes com a classe Vector e quando utilizei o método capacity() no código abaixo ele retornou o valor 8. De onde veio esse 8 :?: :?: :?:
public class Main {
public Main() {}
public static void main(String[] args) {
Vector testeVetor = new Vector(0);
String txt1 = "S";
String txt2 = "h";
String txt3 = "a";
String txt4 = "d";
String txt5 = "o";
String txt6 = "w";
testeVetor.addElement(txt1);
testeVetor.addElement(txt2);
testeVetor.addElement(txt3);
testeVetor.addElement(txt4);
testeVetor.addElement(txt5);
testeVetor.addElement(txt6);
System.out.println("" + testeVetor.capacity());
}
}