In this simple example, i want to create a String array populated with each person's first and last in my DB. I know i am missing something very obvious as i keep overriding i in the following looping method. A second eye would certainly help.
/**
*
* @return
*/
public String[] buildFullNameContainer(){
List<Person> allPeople = Person.findAllPeople();
String[] peopleContainer = new String[] {""};
String fullName = "";
for (int i = 0; i < peopleContainer.length; i++) {
for (Person person : allPeople) {
fullName = person.getFirstName() + " " + person.getLastName();
peopleContainer[i] = fullName;
}
}
return peopleContainer;
}