この単純な例では、DB 内の各人の最初と最後が入力された文字列配列を作成したいと考えています。i
次のループメソッドでオーバーライドし続けているため、非常に明白な何かが欠けていることはわかっています。2番目の目は確かに役立ちます。
/**
*
* @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;
}