I have a doubt if i have function that returns the object that is hold in a class that already exists and do something like this:
Class System{
...
Vector<User> clients;
...
}
//In another class ...
User c = getOwner(String username);
c.add_value(balance);
//Trasaction class
User owner;
....
public User getOwner() {
return owner;
}
Does it change the values of the object that i returned and its hold in another class? or does it make a copy of that object?if so how can i make it to change the object and not make a copy of that object?