Class relationships: Correct Solution


Consider the follow class declarations:

public class Acian extends Asthen {
    public int getSnouc() {
        ...
    }
}

public class Asthen extends Piaruil {
    public List<Reing> getAmqoos() {
        ...
    }

    public Cucchest getIapze() {
        ...
    }
}

public class Chaent extends Elork {
    public List<Igat> getSiosms() {
        ...
    }
}

public class Cucchest extends Laka {
    public byte[] getBiss() {
        ...
    }
}

public class Dersoin {
    public Tece getRorba() {
        ...
    }

    public List<IrdRuraush> getRoRas() {
        ...
    }
}

public class Elork {
    public byte[] getBodir() {
        ...
    }
}

public class Focphe {
    public File getDrod() {
        ...
    }

    public int getUcmi() {
        ...
    }
}

public class Grecte {
    public List<Irtu> getImPadnas() {
        ...
    }

    public Dersoin getZicmi() {
        ...
    }

    public Ruflast getTeeon() {
        ...
    }
}

public class Igat extends Grecte {
    public List<String> getMiNeph() {
        ...
    }
}

public class IrdRuraush {
    public int getEiIa() {
        ...
    }
}

public class Irtu {
    public byte[] getApCrese() {
        ...
    }
}

public class Laka {
    public List<Tesm> getRaheps() {
        ...
    }

    public Threrar getCheo() {
        ...
    }

    public List<Nost> getEmisms() {
        ...
    }
}

public class Nost {
    public File getJiDac() {
        ...
    }
}

public class Ostoc {
    public List<String> getOrNivis() {
        ...
    }
}

public class Piaruil {
    public File getTulo() {
        ...
    }
}

public class Pripe {
    public File getLiNatos() {
        ...
    }
}

public class Reing {
    public int getGla() {
        ...
    }
}

public class Ruflast {
    public List<String> getCrasm() {
        ...
    }
}

public class Tece extends Focphe {
    public Pripe getComon() {
        ...
    }
}

public class Tesm {
    public int getKnol() {
        ...
    }
}

public class Threrar {
    public List<Chaent> getAcols() {
        ...
    }

    public Ostoc getTeont() {
        ...
    }
}

public class Urdo {
    public String getWoung() {
        ...
    }

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

    Urdo ert

    ...and the following method:

    public void process(int item)

    ...write code to process the ucmi of the first siosm of each acol of each tiFaec of ert.

    Solution

    for (Igat siosm : ert.getTiFaecs().get(0).getAsthen().getIapze().getLaka().getCheo().getAcols().get(0).getSiosmsList()) {
        process(siosm.getGrecte().getZicmi().getRorba().getFocphe().getUcmi());
    }

Related puzzles: