Class relationships: Correct Solution


Consider the follow class declarations:

public class Bous extends Venle {
    public List<Cetroc> getOcos() {
        ...
    }
}

public class Cetroc {
    public List<String> getDopi() {
        ...
    }
}

public class Dossec {
    public int getEsmal() {
        ...
    }

    public Bous getUga() {
        ...
    }
}

public class HarTirk {
    public String getHepor() {
        ...
    }
}

public class Ichess {
    public byte[] getWhoki() {
        ...
    }
}

public class OheEne extends Psouss {
    public List<Suenwear> getEdas() {
        ...
    }

    public HarTirk getGusqo() {
        ...
    }
}

public class Prodheu {
    public String getNeFrest() {
        ...
    }
}

public class Psouss {
    public int getMosoo() {
        ...
    }
}

public class Sidme {
    public List<TreDiw> getInKeacs() {
        ...
    }

    public byte[] getQic() {
        ...
    }
}

public class Suenwear extends Dossec {
    public List<String> getOss() {
        ...
    }
}

public class TreDiw {
    public File getAsel() {
        ...
    }

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

public class Venle extends Prodheu {
    public Ichess getPhent() {
        ...
    }

    public Sidme getSiIru() {
        ...
    }
}
  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:

    OheEne na

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the irham of the first inKeac of each eda of na.

    Solution

    for (TreDiw inKeac : na.getEdas().get(0).getDossec().getUga().getVenle().getSiIru().getInKeacsList()) {
        process(inKeac.getIrham());
    }

Related puzzles: