Class relationships: Correct Solution


Consider the follow class declarations:

public class Aeae {
    public int getSirir() {
        ...
    }

    public Scriacec getHeari() {
        ...
    }
}

public class Arfeng {
    public List<String> getUfUruin() {
        ...
    }
}

public class Castred {
    public int getCaEnt() {
        ...
    }

    public List<Trolqil> getSeses() {
        ...
    }
}

public class Ciast {
    public Edces getKust() {
        ...
    }

    public String getLasga() {
        ...
    }
}

public class Edces extends Ipraur {
    public List<String> getQeki() {
        ...
    }
}

public class Egir {
    public List<String> getHomb() {
        ...
    }
}

public class Fingpes {
    public Arfeng getPriul() {
        ...
    }

    public String getDipra() {
        ...
    }
}

public class Gomposs {
    public File getOst() {
        ...
    }

    public List<Aeae> getDrans() {
        ...
    }
}

public class Hessste {
    public List<String> getSpir() {
        ...
    }
}

public class Ipraur extends Ucol {
    public List<Momol> getAchos() {
        ...
    }

    public Thit getMeEw() {
        ...
    }
}

public class Momol extends Gomposs {
    public List<Hessste> getJeQepas() {
        ...
    }
}

public class Mumick {
    public List<Castred> getWhashs() {
        ...
    }

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

    public String getAdBi() {
        ...
    }
}

public class Scriacec {
    public Egir getGeen() {
        ...
    }

    public Sensois getIlRil() {
        ...
    }
}

public class Sensois extends Fingpes {
    public List<Uwho> getIosms() {
        ...
    }
}

public class Thit {
    public File getBavot() {
        ...
    }
}

public class Trolqil {
    public List<String> getAuFe() {
        ...
    }
}

public class Ucol {
    public int getBiant() {
        ...
    }
}

public class Uwho extends Mumick {
    public String getSioe() {
        ...
    }
}
  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:

    Ciast aca

    ...and the following method:

    public void process(String item)

    ...write code to process the adBi of the first iosm of each dran of each acho of aca.

    Solution

    for (Uwho iosm : aca.getKust().getIpraur().getAchos().get(0).getGomposs().getDrans().get(0).getHeari().getIlRil().getIosmsList()) {
        process(iosm.getMumick().getAdBi());
    }

Related puzzles: