Class relationships: Correct Solution


Consider the follow class declarations:

public class Biun {
    public List<Pren> getCiRos() {
        ...
    }

    public Gidstost getCaFopli() {
        ...
    }
}

public class Chuth {
    public int getHeScio() {
        ...
    }
}

public class Coru {
    public int getEngwa() {
        ...
    }
}

public class CusSanghes {
    public Essleor getOmpoo() {
        ...
    }

    public File getAdko() {
        ...
    }
}

public class Denpron extends Biun {
    public WelKaflor getPoc() {
        ...
    }
}

public class Ectosh {
    public List<Wiomer> getProks() {
        ...
    }

    public String getBenek() {
        ...
    }
}

public class Edcrem {
    public int getCeash() {
        ...
    }
}

public class EsmPri {
    public int getUan() {
        ...
    }
}

public class Essleor extends Terfa {
    public File getHacid() {
        ...
    }
}

public class FriOphoon {
    public byte[] getEoUc() {
        ...
    }

    public List<Chuth> getNiths() {
        ...
    }
}

public class Gidstost {
    public Suoss getQec() {
        ...
    }

    public List<Tosm> getOssvos() {
        ...
    }
}

public class Lambrees {
    public String getBre() {
        ...
    }
}

public class Losstim {
    public byte[] getLisaf() {
        ...
    }

    public Renbia getTarti() {
        ...
    }
}

public class Mecs {
    public String getWoAs() {
        ...
    }

    public Lambrees getIcic() {
        ...
    }
}

public class Pren {
    public File getOrmi() {
        ...
    }
}

public class Renbia extends Ectosh {
    public List<String> getPhen() {
        ...
    }
}

public class Suoss extends VuePelkon {
    public Edcrem getAtron() {
        ...
    }

    public List<Mecs> getScelds() {
        ...
    }
}

public class Terfa extends FriOphoon {
    public List<String> getEmci() {
        ...
    }

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

public class Tosm {
    public int getArRac() {
        ...
    }

    public EsmPri getEsro() {
        ...
    }
}

public class VuePelkon {
    public List<CusSanghes> getRhiis() {
        ...
    }

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

public class WelKaflor {
    public File getDuPec() {
        ...
    }
}

public class Wiomer {
    public List<Coru> getIlIos() {
        ...
    }

    public List<Denpron> getHisms() {
        ...
    }
}
  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:

    Losstim pe

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the beun of each rhii of each hism of each prok of pe.

    Solution

    process(pe.getTarti().getEctosh().getProks().get(0).getHisms().get(0).getBiun().getCaFopli().getQec().getVuePelkon().getRhiis().get(0).getOmpoo().getTerfa().getBeun());

Related puzzles: