Class relationships: Correct Solution


Consider the follow class declarations:

public class AosIussent {
    public List<String> getEsin() {
        ...
    }
}

public class Balcong extends Sousm {
    public File getAsFus() {
        ...
    }
}

public class Clai {
    public List<String> getTet() {
        ...
    }
}

public class Entshrek {
    public List<Eres> getAngs() {
        ...
    }

    public List<AosIussent> getCaLeels() {
        ...
    }
}

public class Eres {
    public Nedstrel getMiil() {
        ...
    }

    public List<Scenla> getPaRis() {
        ...
    }
}

public class Gini {
    public List<String> getPilo() {
        ...
    }
}

public class Nedstrel {
    public int getAlLia() {
        ...
    }

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

public class Radil extends Vildee {
    public List<Balcong> getShros() {
        ...
    }
}

public class Scenla {
    public File getMooss() {
        ...
    }
}

public class Sousm extends Entshrek {
    public Gini getVeode() {
        ...
    }

    public Clai getDeDrar() {
        ...
    }
}

public class Vildee {
    public String getPoc() {
        ...
    }
}

public class Vioc {
    public int getPirel() {
        ...
    }

    public Radil getLudi() {
        ...
    }
}
  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:

    Vioc en

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the olSerda of each ang of each shro of en.

    Solution

    process(en.getLudi().getShros().get(0).getSousm().getEntshrek().getAngs().get(0).getMiil().getOlSerda());

Related puzzles: