I have an array of the Person class called vector.
I have already populated the vector with the instances of people named p1
.
My question is how to change the value of p1
when inside the array :
Example:
Person Array named Vector:
Pessoa p1 = new Pessoa();
vetor.add(p1);
To get the name for example would be:
vetor.get(posicao).getNome();
and works perfectly.
Now how do I set the name?
I tried
vetor.set(posicao).setNome();
and does not work.