Class relationships: Correct Solution


Consider the follow class declarations:

public class Atbec {
    public List<String> getIdui() {
        ...
    }
}

public class Bueiss {
    public Deuer getVodau() {
        ...
    }

    public List<Desad> getPernos() {
        ...
    }
}

public class Croiglu {
    public List<String> getPhe() {
        ...
    }

    public Atbec getBeti() {
        ...
    }

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

public class Desad {
    public byte[] getPaIomdi() {
        ...
    }
}

public class Deuer extends Stranoc {
    public Engstesm getIrSatam() {
        ...
    }
}

public class Engstesm {
    public List<Croiglu> getMasmus() {
        ...
    }

    public File getHese() {
        ...
    }
}

public class Lillar extends Onag {
    public String getOng() {
        ...
    }
}

public class Onag extends Sche {
    public List<Bueiss> getReMenks() {
        ...
    }
}

public class Sche {
    public String getEcke() {
        ...
    }
}

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

    Lillar pide

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the liPris of each masmu of each reMenk of pide.

    Solution

    process(pide.getOnag().getReMenks().get(0).getVodau().getIrSatam().getMasmus().get(0).getLiPris());

Related puzzles: