1
I have an array of the Person class called vector.
I already populated the vector with instances of named persons of p1
.
My question is how to change the value of p1
when you’re inside the array:
Example:
Person array called vector:
Pessoa p1 = new Pessoa();
vetor.add(p1);
To take the name for example would be:
vetor.get(posicao).getNome();
and works perfectly.
Now how do I set the name?
I tried to
vetor.set(posicao).setNome();
and it doesn’t work.
Could post how the array was created? you already tried vector.get(position). setName()?
– Giullianogp