package com.javarush.task.task07.task0724;

import java.io.IOException;
import java.util.ArrayList;

public class Solution {
    public final static ArrayList<Human> humans = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        Human human0 = new Human("Tom", true, 90);
        humans.add(human0);
        Human human1 = new Human("Bill", true, 95);
        humans.add(human1);
        Human human2 = new Human("Mary", false, 80);
        humans.add(human2);
        Human human3 = new Human("Jenny", false, 85);
        humans.add(human3);
        Human human4 = new Human("Jack", true, 45, human0, human2);
        humans.add(human4);
        Human human5 = new Human("Nelly", false, 37, human1, human3);
        humans.add(human5);
        Human human6 = new Human("Kris", true, 18, human4, human5);
        humans.add(human6);
        Human human7 = new Human("Greg", true, 14, human4, human5);
        humans.add(human7);
        Human human8 = new Human("Maya", false, 8, human4, human5);
        humans.add(human8);

        printList();}

    public static void printList() {
        for (int x = 0; x < humans.size(); x++) {System.out.println(humans.get(x));}}

    public static class Human {
        public String name;
        public boolean sex;
        public int age;
        public Human father;
        public Human mother;

        Human(String name, boolean sex, int age) {
            this.name = name;
            this.sex = sex;
            this.age = age;}

        Human(String name, boolean sex, int age, Human father, Human mother) {
            this.name = name;
            this.sex = sex;
            this.age = age;
            this.father = father;
            this.mother = mother;}

        public String toString() {
            String text = "";
            text += "Имя: " + this.name;
            text += ", пол: " + (this.sex ? "мужской" : "женский");
            text += ", возраст: " + this.age;

            if (this.father != null)
                text += ", отец: " + this.father.name;

            if (this.mother != null)
                text += ", мать: " + this.mother.name;

            return text;}}}
Подскажите, как добавить хуманов в массив циклом, а не по одному?