Class relationships: Correct Solution


Consider the follow class declarations:

public class ChuSengmed {
    public String getReou() {
        ...
    }

    public List<Sningrioss> getErpes() {
        ...
    }
}

public class Cuich {
    public File getCiown() {
        ...
    }

    public Drentesm getMeSaswi() {
        ...
    }
}

public class Dorea {
    public List<Cuich> getMuings() {
        ...
    }

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

public class Drentesm {
    public byte[] getOlDudle() {
        ...
    }

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

public class Eocas {
    public Flepro getNasm() {
        ...
    }

    public EsiPofo getEvu() {
        ...
    }
}

public class EsiPofo extends Pranmei {
    public byte[] getTrupo() {
        ...
    }
}

public class EteIshge {
    public File getDiHatu() {
        ...
    }
}

public class Flepro extends EteIshge {
    public List<String> getSmint() {
        ...
    }
}

public class Ismneth {
    public List<Eocas> getDiacs() {
        ...
    }

    public File getSte() {
        ...
    }
}

public class Maeitch {
    public List<String> getArhu() {
        ...
    }

    public List<Sphiste> getDaPamids() {
        ...
    }
}

public class Pranmei extends ChuSengmed {
    public List<Roieanx> getStrahs() {
        ...
    }

    public List<Warias> getProes() {
        ...
    }
}

public class Rign {
    public String getFoLi() {
        ...
    }
}

public class Roieanx {
    public File getAno() {
        ...
    }
}

public class Sningrioss extends Rign {
    public Dorea getOnEn() {
        ...
    }

    public Maeitch getSqu() {
        ...
    }
}

public class Sphiste {
    public byte[] getPris() {
        ...
    }
}

public class Warias {
    public File getRaLegh() {
        ...
    }
}
  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:

    Ismneth fis

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the imtwe of each muing of each erpe of the first diac of fis.

    Solution

    for (Eocas diac : fis.getDiacsList()) {
        process(diac.getEvu().getPranmei().getChuSengmed().getErpes().get(0).getOnEn().getMuings().get(0).getMeSaswi().getImtwe());
    }

Related puzzles: