Class relationships: Correct Solution


Consider the follow class declarations:

public class Angpre extends Tresi {
    public Eheng getFaCiaw() {
        ...
    }
}

public class Coserph {
    public byte[] getVuUngro() {
        ...
    }
}

public class Edmeoss extends Selos {
    public File getKucfa() {
        ...
    }
}

public class Eheng {
    public List<String> getNoc() {
        ...
    }

    public List<Edmeoss> getEmEcs() {
        ...
    }
}

public class Hidscru {
    public List<String> getPaSasm() {
        ...
    }
}

public class Selos {
    public String getPlepe() {
        ...
    }

    public List<Tesnu> getChasos() {
        ...
    }
}

public class Tesnu {
    public Hidscru getToos() {
        ...
    }

    public int getStee() {
        ...
    }

    public List<String> getCohi() {
        ...
    }
}

public class Tresi {
    public Coserph getIsae() {
        ...
    }

    public byte[] getTuses() {
        ...
    }
}
  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:

    Angpre el

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the cohi of each chaso of each emEc of el.

    Solution

    process(el.getFaCiaw().getEmEcs().get(0).getSelos().getChasos().get(0).getCohi());

Related puzzles: