Class relationships: Correct Solution


Consider the follow class declarations:

public class Aled {
    public byte[] getCufol() {
        ...
    }
}

public class Borac extends SpiIshde {
    public Giren getUlhi() {
        ...
    }
}

public class Cang {
    public int getEcuc() {
        ...
    }
}

public class Cishdial {
    public String getErdac() {
        ...
    }

    public Pirtid getArpe() {
        ...
    }
}

public class Edbou {
    public byte[] getEaTudas() {
        ...
    }
}

public class EmaOncher {
    public List<Edbou> getEerases() {
        ...
    }

    public List<Cishdial> getIdKeluls() {
        ...
    }
}

public class Giren {
    public int getMaMucde() {
        ...
    }
}

public class IroGente extends Stasso {
    public Cang getIsSce() {
        ...
    }

    public Borac getTaAn() {
        ...
    }
}

public class Miocoal extends Psem {
    public byte[] getFuMueho() {
        ...
    }
}

public class Paisce {
    public byte[] getCuc() {
        ...
    }
}

public class Pirtid extends Miocoal {
    public List<Paisce> getPeRinqes() {
        ...
    }
}

public class PriDicpru {
    public String getRuno() {
        ...
    }
}

public class Psem {
    public List<String> getRinpa() {
        ...
    }

    public List<Shadnalf> getRetids() {
        ...
    }
}

public class Shadnalf {
    public IroGente getMiNacet() {
        ...
    }

    public List<PriDicpru> getNewhus() {
        ...
    }
}

public class SpiIshde {
    public byte[] getNin() {
        ...
    }

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

public class Stasso extends Aled {
    public int getIoc() {
        ...
    }
}
  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:

    EmaOncher eser

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the stren of each retid of the first idKelul of eser.

    Solution

    for (Cishdial idKelul : eser.getIdKelulsList()) {
        process(idKelul.getArpe().getMiocoal().getPsem().getRetids().get(0).getMiNacet().getTaAn().getSpiIshde().getStren());
    }

Related puzzles: