Class relationships: Correct Solution


Consider the follow class declarations:

public class Cenock extends VosShexar {
    public List<Wesesm> getSiQidids() {
        ...
    }
}

public class Cipud {
    public List<TruGanae> getCaphos() {
        ...
    }

    public int getIoMitio() {
        ...
    }
}

public class Citoc extends Thal {
    public List<Cipud> getQers() {
        ...
    }
}

public class Cucud {
    public List<String> getResi() {
        ...
    }

    public Leousm getUnt() {
        ...
    }
}

public class Desschrua extends Sosom {
    public List<HilBrasio> getEmMuics() {
        ...
    }

    public List<Maliont> getDicos() {
        ...
    }
}

public class Entoun {
    public int getSioct() {
        ...
    }

    public Sloshi getOuca() {
        ...
    }

    public int getSler() {
        ...
    }
}

public class HilBrasio {
    public File getQaAhal() {
        ...
    }

    public SceRolcesk getMagre() {
        ...
    }
}

public class Leousm extends Tije {
    public String getErm() {
        ...
    }
}

public class Maliont extends Cucud {
    public byte[] getPlel() {
        ...
    }
}

public class RaiNonblet {
    public Entoun getSas() {
        ...
    }

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

public class SceRolcesk {
    public String getFips() {
        ...
    }
}

public class Sloshi {
    public int getPaPra() {
        ...
    }
}

public class Sosom {
    public int getPse() {
        ...
    }
}

public class Spana {
    public Desschrua getMaGlir() {
        ...
    }

    public File getBem() {
        ...
    }
}

public class Strei {
    public int getEtPio() {
        ...
    }

    public List<Spana> getVaecis() {
        ...
    }
}

public class Thal {
    public File getCrul() {
        ...
    }

    public Strei getFri() {
        ...
    }
}

public class Tije {
    public List<RaiNonblet> getPems() {
        ...
    }

    public Cenock getTodri() {
        ...
    }
}

public class TruGanae {
    public List<String> getIsell() {
        ...
    }
}

public class VosShexar {
    public byte[] getApNunt() {
        ...
    }
}

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

    Citoc fes

    ...and the following method:

    public void process(int item)

    ...write code to process the sler of each pem of the first dico of each vaeci of fes.

    Solution

    for (Maliont dico : fes.getThal().getFri().getVaecis().get(0).getMaGlir().getDicosList()) {
        process(dico.getCucud().getUnt().getTije().getPems().get(0).getSas().getSler());
    }

Related puzzles: