My program has an Object Class `Person`. A Person object consists of a String `name` (which is the name of a person) and a 6 element string array `choices`. The array holds the values that the user enters to rank 6 different sports from most preferred to least preffered.

For example, a Person object called `testPerson` could consist of a String set as `"Bob"` and an array with each element as follows `{3,1,4,2,5,6}`. (The second sport that was listed was Bob's most preferred sport and the last sport listed was his least preferred).

That example object can be created with the following code:

```
String[] tempArray = new String[]{"3","1","4","2","5","6"};
Person newPerson = Person("Bob",tempArray);

```

Here is the Person class:

```
public class Person{
    private String[] choices = new String[6];
    private String name;
    //constructor
    public Person(String myName, String[] myInput){
        choices = myInput;
        name = myName;
    }
    //returns the choices array
    public String[] getChoices(){
        return(choices);
    }
    //returns the name
    public String getName(){
        return(name);
    }
}

```

I create a new object every time a new user enters their name and choices. Since I don't know how many times a new user will enter their details, I store each new object within an ArrayList called "people". (Yes, I know... An array within an object within an ArrayList)

After all (unknown number of) users have entered their information a button is pressed indicating that there are no more users to enter information. At this point I need to access both the name and the choices array for each person object
To do this I would obviously use a for each loop. This is how I set it up:

```
String[] myChoices = new String[6];
String myName;
for(Person getPerson: people){
    myChoices = getPerson.getChoices();
    myName = getPerson.getName();
    //print name and choices
    System.out.println(myName);
    for(int i = 0; i < 6; i ++){
        System.out.println(myChoices[i]);
    }
}

```

That "for each" loop should print the name and each element of the 6 element array and it will do it for each object that was added to the ArrayList of people. In other words, if 10 people input their name and their choices, it would print each person's name along with their choices in the order they entered them.

However, when I run the code, it displays each different name but under each name it displays the choices that belong only to the last person to enter their choices.
For example, if Bob enters 3,2,1,6,5,4 ; Tom enters 1,3,5,2,4,6; and Bill enters 2,1,4,3,6,5, the following will be displayed:

Bob
2
1
4
3
6
5

Tom
2
1
4
3
6
5

Bill
2
1
4
3
6
5

Obviously that isn't right. But I don't understand why it's displaying each name properly but it only displays the most recently entered choices for each person. It's as though the getName() method in the Person class returns the respective name for each object but the getChoices() method returns the most recent choices array rather than the respective choices array for each object. Could anyone help? Let me know if I need to clarify anything. Thanks in Advance!