Class relationships: Correct Solution


Consider the follow class declarations:

public class Bross extends Poaint {
    public List<FicRhoan> getBeEfests() {
        ...
    }
}

public class Cosla {
    public String getRis() {
        ...
    }

    public PsoThul getWuth() {
        ...
    }
}

public class FicRhoan extends Cosla {
    public File getWii() {
        ...
    }
}

public class Hiontpod {
    public List<String> getMueor() {
        ...
    }
}

public class Poaint {
    public File getEsbit() {
        ...
    }

    public List<Prer> getHils() {
        ...
    }
}

public class Prer {
    public byte[] getThenu() {
        ...
    }
}

public class PsoThul {
    public String getTrivi() {
        ...
    }

    public List<Truarmgic> getSeengs() {
        ...
    }
}

public class Truarmgic {
    public Hiontpod getPrass() {
        ...
    }

    public String getDioun() {
        ...
    }

    public File getArTo() {
        ...
    }
}
  1. Draw a diagram showing the class relationships.

    You only need to diagram the classes listed above. You only need to show the name of each class; do not show their methods or properties.

    Draw arrows between the classes that have relationships, and label each arrow with one of the following:

    Make sure your arrows point in the correct direction!

    Solution

  2. Given the following variable:

    Bross gelk

    ...and the following method:

    public void process(File item)

    ...write code to process the arTo of the first seeng of each beEfest of gelk.

    Solution

    for (Truarmgic seeng : gelk.getBeEfests().get(0).getCosla().getWuth().getSeengsList()) {
        process(seeng.getArTo());
    }

Related puzzles: