// Project: Recursion // Module: FamilyTree // Source code file: Person.java // The instance variables are the name and age // of the person and the ArrayList object containing // that person's children. import java.util.ArrayList; public class Person { private String name; private int age; private ArrayList children; public Person(String theName, int theAge) { name = theName; age = theAge; children = new ArrayList(); } public String getName() { return name; } public void addChild(Person thePerson) { children.add(thePerson); } public Person getChild(int index) { return children.get(index); } public int getNumberOfChildren() { return children.size(); } @Override public String toString( ) { return name + " " + age; } }