Class relationships: Correct Solution


Consider the follow class declarations:

public class Ahest extends Dala {
    public List<MurLos> getKeshs() {
        ...
    }

    public List<Scre> getGris() {
        ...
    }
}

public class Ardspa extends Rhonves {
    public String getNeDe() {
        ...
    }
}

public class BieCelrin {
    public String getQis() {
        ...
    }
}

public class Cadmo {
    public List<BieCelrin> getBuCiongs() {
        ...
    }

    public Ahest getRac() {
        ...
    }
}

public class CimMiome {
    public List<String> getSux() {
        ...
    }
}

public class Dala {
    public String getGlosa() {
        ...
    }
}

public class DeuOssda {
    public File getReou() {
        ...
    }
}

public class FliCer extends Cadmo {
    public Mebril getUlBa() {
        ...
    }
}

public class Hiaga {
    public File getPoul() {
        ...
    }
}

public class Mebril {
    public List<String> getFiVuss() {
        ...
    }
}

public class Mounhi {
    public String getPhael() {
        ...
    }

    public List<Ardspa> getSlais() {
        ...
    }
}

public class MurLos {
    public int getHio() {
        ...
    }
}

public class Pailoc {
    public List<FliCer> getAcCaals() {
        ...
    }

    public CimMiome getEnSte() {
        ...
    }
}

public class Prarnses extends Mounhi {
    public int getEcint() {
        ...
    }
}

public class Rhonves extends Hiaga {
    public DeuOssda getVed() {
        ...
    }

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

public class Scre {
    public Prarnses getCiNer() {
        ...
    }

    public int getDaMocad() {
        ...
    }
}
  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:

    Pailoc imoc

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the eior of each slai of each gri of each acCaal of imoc.

    Solution

    process(imoc.getAcCaals().get(0).getCadmo().getRac().getGris().get(0).getCiNer().getMounhi().getSlais().get(0).getRhonves().getEior());

Related puzzles: