Class relationships: Correct Solution


Consider the follow class declarations:

public class BicCitil extends Opcem {
    public byte[] getSafem() {
        ...
    }
}

public class Cenphot {
    public byte[] getWrac() {
        ...
    }
}

public class Crar {
    public String getSouf() {
        ...
    }
}

public class DioGradha {
    public int getAkSoa() {
        ...
    }
}

public class Ecas extends Onflism {
    public List<String> getOoss() {
        ...
    }

    public String getHess() {
        ...
    }
}

public class Eist {
    public int getAel() {
        ...
    }
}

public class GicChuth {
    public List<BicCitil> getNosses() {
        ...
    }

    public File getHac() {
        ...
    }
}

public class Hencess {
    public String getGark() {
        ...
    }

    public GicChuth getAcDepi() {
        ...
    }
}

public class IolFlosing {
    public List<Cenphot> getSecis() {
        ...
    }

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

public class IthCiotpra {
    public int getErXi() {
        ...
    }

    public Ecas getIarbe() {
        ...
    }
}

public class KiaOuss {
    public byte[] getEnOr() {
        ...
    }
}

public class Onflism {
    public File getBomar() {
        ...
    }
}

public class Opcem {
    public Peil getBou() {
        ...
    }

    public int getFasem() {
        ...
    }
}

public class OsoCacqac {
    public IolFlosing getHece() {
        ...
    }

    public int getBuImhi() {
        ...
    }
}

public class Peddung {
    public int getFapro() {
        ...
    }

    public List<Raup> getPaCos() {
        ...
    }
}

public class Peil {
    public List<Sespra> getTeiods() {
        ...
    }

    public List<KiaOuss> getMuas() {
        ...
    }
}

public class Raup {
    public List<Storduck> getMaCagils() {
        ...
    }

    public Statra getZuric() {
        ...
    }

    public Tondtrod getEsh() {
        ...
    }
}

public class Sespra extends Solgu {
    public List<String> getPliel() {
        ...
    }
}

public class Solgu {
    public List<IthCiotpra> getEmNes() {
        ...
    }

    public File getHeass() {
        ...
    }
}

public class Statra extends Hencess {
    public byte[] getAsbu() {
        ...
    }
}

public class Storduck extends OsoCacqac {
    public DioGradha getRarn() {
        ...
    }
}

public class Tondtrod extends Eist {
    public List<Crar> getViophs() {
        ...
    }
}
  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:

    Peddung eird

    ...and the following method:

    public void process(String item)

    ...write code to process the hess of the first emNe of each teiod of each noss of each paCo of eird.

    Solution

    for (IthCiotpra emNe : eird.getPaCos().get(0).getZuric().getHencess().getAcDepi().getNosses().get(0).getOpcem().getBou().getTeiods().get(0).getSolgu().getEmNesList()) {
        process(emNe.getIarbe().getHess());
    }

Related puzzles: