Class relationships: Correct Solution


Consider the follow class declarations:

public class Anth {
    public byte[] getChle() {
        ...
    }
}

public class Beilauck {
    public byte[] getMiAd() {
        ...
    }
}

public class Beung {
    public File getFla() {
        ...
    }
}

public class Caucul {
    public List<Tisshoc> getNirts() {
        ...
    }

    public List<Anth> getPeWhaeos() {
        ...
    }
}

public class Cinsqun {
    public File getCac() {
        ...
    }
}

public class Elre extends Beung {
    public Hium getBosas() {
        ...
    }
}

public class Ener {
    public String getOnuic() {
        ...
    }
}

public class HeaAdmis {
    public int getOcqua() {
        ...
    }
}

public class Hium {
    public List<String> getOrEnad() {
        ...
    }
}

public class Iacunt {
    public List<Cinsqun> getLehos() {
        ...
    }

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

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

public class Menoss {
    public byte[] getMuUl() {
        ...
    }
}

public class Midat {
    public List<Pael> getDris() {
        ...
    }

    public Shra getSarul() {
        ...
    }
}

public class Olpa {
    public File getDeFa() {
        ...
    }
}

public class Pael {
    public List<Ener> getAlAclias() {
        ...
    }

    public Menoss getNopo() {
        ...
    }
}

public class Phenmur {
    public List<PniFre> getQoEpesms() {
        ...
    }

    public Olpa getBriu() {
        ...
    }
}

public class Ploco {
    public int getCildo() {
        ...
    }

    public Phenmur getOul() {
        ...
    }
}

public class PniFre extends Iacunt {
    public List<Elre> getCaCiks() {
        ...
    }
}

public class Rasmla {
    public byte[] getTaHios() {
        ...
    }

    public List<Midat> getSeuns() {
        ...
    }
}

public class Rast {
    public byte[] getNoust() {
        ...
    }

    public List<ZinMessio> getEous() {
        ...
    }
}

public class Ritbreph extends Rasmla {
    public String getIbi() {
        ...
    }
}

public class Shra extends Caucul {
    public Beilauck getPlid() {
        ...
    }
}

public class Tisshoc {
    public HeaAdmis getHoa() {
        ...
    }

    public Rast getGeBe() {
        ...
    }
}

public class Tussklul {
    public int getSoAnpic() {
        ...
    }

    public Ritbreph getAslu() {
        ...
    }
}

public class ZinMessio extends Ploco {
    public File getCet() {
        ...
    }
}
  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:

    Tussklul girm

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the stoll of each qoEpesm of each eou of each nirt of each seun of girm.

    Solution

    process(girm.getAslu().getRasmla().getSeuns().get(0).getSarul().getCaucul().getNirts().get(0).getGeBe().getEous().get(0).getPloco().getOul().getQoEpesms().get(0).getIacunt().getStoll());

Related puzzles: