I have the following class:
public class Profile{
String name, age, location;
}
Say that I then have the following code:
ArrayList<Profile> profiles = somePopulatedArrayList;
Profile profile = profiles.get(1);
profile.name = "New name here";
My question is when I have the above, is the .name of the object in the ArrayList getting updated, or am I creating a completely new object here and only changing the .name of that object while the Profile object stored in the ArrayList still has the old name?
I'm trying to edit properties of objects in the ArrayList and I'm wondering if the above approach is correct or not?