Class relationships: Correct Solution


Consider the follow class declarations:

public class Aedpro extends CedDoulad {
    public List<Eadod> getResses() {
        ...
    }
}

public class Asshrars {
    public Slerstad getEcAepou() {
        ...
    }

    public Aedpro getDic() {
        ...
    }
}

public class Caedcho {
    public int getAmol() {
        ...
    }

    public List<Smotmel> getTasts() {
        ...
    }
}

public class CedDoulad extends Rarthar {
    public Slisar getAsOunta() {
        ...
    }

    public Hefeng getPiort() {
        ...
    }
}

public class Chral {
    public File getIss() {
        ...
    }

    public List<Asshrars> getSefeas() {
        ...
    }
}

public class Eadod {
    public Thoilid getQoss() {
        ...
    }

    public List<Liounstax> getRerks() {
        ...
    }
}

public class Ebang extends Sumce {
    public Kissnoo getNiChroi() {
        ...
    }
}

public class Ecclel {
    public String getPeEerph() {
        ...
    }

    public List<Teker> getIcis() {
        ...
    }
}

public class Hefeng extends Ecclel {
    public String getOai() {
        ...
    }
}

public class Istac {
    public byte[] getSaud() {
        ...
    }

    public Ebang getBiErch() {
        ...
    }
}

public class Kissnoo extends Wrores {
    public List<Niphem> getDePas() {
        ...
    }
}

public class Korri {
    public List<Istac> getIrcics() {
        ...
    }

    public int getXanso() {
        ...
    }
}

public class Liounstax {
    public Caedcho getRalp() {
        ...
    }

    public int getNuss() {
        ...
    }
}

public class Niphem {
    public int getCle() {
        ...
    }
}

public class Rarthar {
    public int getCrai() {
        ...
    }
}

public class Slerstad {
    public byte[] getEha() {
        ...
    }
}

public class Slisar {
    public byte[] getCer() {
        ...
    }
}

public class Smotmel {
    public String getMecie() {
        ...
    }
}

public class Sumce {
    public File getVoic() {
        ...
    }
}

public class Teker extends Korri {
    public String getUan() {
        ...
    }
}

public class Thoilid {
    public int getCiss() {
        ...
    }
}

public class Wrores {
    public int getUss() {
        ...
    }

    public String getVoee() {
        ...
    }
}
  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:

    Chral mi

    ...and the following method:

    public void process(String item)

    ...write code to process the voee of the first ircic of the first ici of each sefea of mi.

    Solution

    for (Teker ici : mi.getSefeas().get(0).getDic().getCedDoulad().getPiort().getEcclel().getIcisList()) {
        for (Istac ircic : ici.getKorri().getIrcicsList()) {
            process(ircic.getBiErch().getNiChroi().getWrores().getVoee());
        }
    }

Related puzzles: