Class relationships: Correct Solution


Consider the follow class declarations:

public class DikTegos extends Mollcin {
    public int getDaco() {
        ...
    }
}

public class Docsish {
    public List<DikTegos> getIongs() {
        ...
    }

    public File getKaod() {
        ...
    }

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

public class Finful {
    public byte[] getEto() {
        ...
    }
}

public class Hess extends Thrirvel {
    public File getOcMapou() {
        ...
    }
}

public class Mollcin {
    public Pirkmi getAlMa() {
        ...
    }

    public File getSaOssie() {
        ...
    }
}

public class Orndur extends Ourdkes {
    public int getOesso() {
        ...
    }
}

public class Ourdkes {
    public List<Docsish> getTians() {
        ...
    }

    public Finful getUrIhil() {
        ...
    }
}

public class Pirkmi {
    public int getOnFok() {
        ...
    }
}

public class ReuOun extends Thila {
    public Orndur getNin() {
        ...
    }
}

public class Seclesm {
    public Hess getTria() {
        ...
    }

    public String getCesa() {
        ...
    }
}

public class Thila {
    public byte[] getJadfi() {
        ...
    }
}

public class Thrirvel {
    public byte[] getCasca() {
        ...
    }

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

    Seclesm os

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the aeId of the first tian of each thi of os.

    Solution

    for (Docsish tian : os.getTria().getThrirvel().getThis().get(0).getNin().getOurdkes().getTiansList()) {
        process(tian.getAeId());
    }

Related puzzles: