Class relationships: Correct Solution


Consider the follow class declarations:

public class Beda {
    public File getUtUph() {
        ...
    }

    public Uirm getBlei() {
        ...
    }
}

public class Besmioud {
    public String getGriis() {
        ...
    }
}

public class Biokhes extends Deplas {
    public Sasdu getCaphe() {
        ...
    }
}

public class Buldes extends Prol {
    public byte[] getBilji() {
        ...
    }
}

public class Deplas {
    public File getElo() {
        ...
    }
}

public class Ectic extends Qund {
    public List<Ultro> getSaRhers() {
        ...
    }
}

public class Finselk {
    public File getStuwo() {
        ...
    }

    public List<Biokhes> getErgis() {
        ...
    }
}

public class Gaci {
    public List<Buldes> getEssses() {
        ...
    }

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

public class Hirthniss {
    public Besmioud getOnPrii() {
        ...
    }

    public Gaci getPle() {
        ...
    }
}

public class Prol extends Scoa {
    public Ectic getPra() {
        ...
    }
}

public class Qund {
    public List<Finselk> getEsthos() {
        ...
    }

    public int getDibar() {
        ...
    }
}

public class Sasdu {
    public List<String> getNac() {
        ...
    }
}

public class Scoa {
    public List<String> getEsh() {
        ...
    }
}

public class Trehse extends Hirthniss {
    public int getVed() {
        ...
    }
}

public class Uirm {
    public int getDusm() {
        ...
    }

    public List<Trehse> getOshoms() {
        ...
    }
}

public class Ultro {
    public String getEcste() {
        ...
    }

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

    Beda ilep

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the ocBeae of each saRher of each essse of the first oshom of ilep.

    Solution

    for (Trehse oshom : ilep.getBlei().getOshomsList()) {
        process(oshom.getHirthniss().getPle().getEssses().get(0).getProl().getPra().getSaRhers().get(0).getOcBeae());
    }

Related puzzles: