Class relationships: Correct Solution


Consider the follow class declarations:

public class Cecid {
    public List<String> getKaTeu() {
        ...
    }
}

public class Chle extends Gacspe {
    public File getDords() {
        ...
    }
}

public class Churior {
    public byte[] getSezce() {
        ...
    }

    public List<Floper> getMuHineses() {
        ...
    }
}

public class Daism {
    public File getSeRard() {
        ...
    }
}

public class Deff {
    public List<String> getSmil() {
        ...
    }

    public Chle getIec() {
        ...
    }
}

public class Ecob extends Olcle {
    public byte[] getSius() {
        ...
    }
}

public class Enad extends Peud {
    public Shus getSiSte() {
        ...
    }

    public Sint getFlace() {
        ...
    }

    public Gesm getInSolpa() {
        ...
    }
}

public class Enga extends Pelba {
    public List<Triss> getEdouns() {
        ...
    }

    public Churior getRaCuar() {
        ...
    }
}

public class Floper {
    public File getSodel() {
        ...
    }
}

public class Gacspe {
    public List<String> getHuAser() {
        ...
    }

    public String getPhaxe() {
        ...
    }
}

public class Gesm extends Shoao {
    public List<String> getIlVe() {
        ...
    }
}

public class Gocfe {
    public List<Enad> getChres() {
        ...
    }

    public String getThoss() {
        ...
    }
}

public class Hazion {
    public int getGrast() {
        ...
    }
}

public class Olcle {
    public File getDeXael() {
        ...
    }

    public List<Deff> getSchids() {
        ...
    }
}

public class Pelba {
    public byte[] getEsm() {
        ...
    }

    public Puriss getPras() {
        ...
    }
}

public class Peud extends Uponks {
    public Timste getEeAchma() {
        ...
    }
}

public class Puriss {
    public List<Ecob> getAgris() {
        ...
    }

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

public class Shoao {
    public byte[] getIlcih() {
        ...
    }
}

public class Shus {
    public int getBero() {
        ...
    }
}

public class Sint {
    public File getDeae() {
        ...
    }
}

public class Soiep {
    public List<Hazion> getWals() {
        ...
    }

    public Gocfe getShird() {
        ...
    }
}

public class Timste {
    public File getAcen() {
        ...
    }

    public List<Enga> getPhasses() {
        ...
    }
}

public class Triss extends Cecid {
    public File getCaStuc() {
        ...
    }
}

public class Uponks {
    public byte[] getRawa() {
        ...
    }

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

    Soiep eo

    ...and the following method:

    public void process(String item)

    ...write code to process the phaxe of the first schid of each agri of each phass of each chre of eo.

    Solution

    for (Deff schid : eo.getShird().getChres().get(0).getPeud().getEeAchma().getPhasses().get(0).getPelba().getPras().getAgris().get(0).getOlcle().getSchidsList()) {
        process(schid.getIec().getGacspe().getPhaxe());
    }

Related puzzles: