Class relationships: Correct Solution


Consider the follow class declarations:

public class Berthreng {
    public List<Morthing> getDenols() {
        ...
    }

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

public class Celvoum {
    public List<String> getHarli() {
        ...
    }
}

public class Desttheid {
    public Frin getLosue() {
        ...
    }

    public int getLoPiorl() {
        ...
    }
}

public class Eccias {
    public String getSaist() {
        ...
    }
}

public class Frin {
    public String getPral() {
        ...
    }

    public File getPhed() {
        ...
    }
}

public class Hanghu extends Berthreng {
    public List<Pesess> getOsses() {
        ...
    }
}

public class Morthing extends Celvoum {
    public List<Desttheid> getDeOuris() {
        ...
    }

    public List<Eccias> getPabios() {
        ...
    }
}

public class Pesess {
    public byte[] getEfiss() {
        ...
    }
}

public class Serm {
    public Xaien getNen() {
        ...
    }

    public Hanghu getOuhen() {
        ...
    }
}

public class Xaien {
    public File getSedir() {
        ...
    }
}
  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:

    Serm udbe

    ...and the following method:

    public void process(File item)

    ...write code to process the phed of the first deOuri of each denol of udbe.

    Solution

    for (Desttheid deOuri : udbe.getOuhen().getBerthreng().getDenols().get(0).getDeOurisList()) {
        process(deOuri.getLosue().getPhed());
    }

Related puzzles: