The object already exists in another array but i need to add it to another in case there are multiple instances which need to go into the new array.
public void findOldest() {
int oldest = 0;
Person[] oldestPeople = new Person[5];
for(int i = 0; i < groupie.length; i++)
{
if(groupie[i].getAge() >= oldest) {
System.out.println(oldest);
oldest = groupie[i].getAge();
}
}
for(int i = 0; i < groupie.length; i++)
{
if(groupie[i].getAge() == oldest) {
//error below
oldestPeople.add(groupie[i]);
}
}
}