Class relationships: Correct Solution


Consider the follow class declarations:

public class Crerkniam extends Iotro {
    public List<Trecna> getCespus() {
        ...
    }
}

public class Iotro {
    public Karmtod getLalor() {
        ...
    }

    public int getPaf() {
        ...
    }
}

public class Karmtod {
    public List<Neniss> getPhes() {
        ...
    }

    public Vilder getIxt() {
        ...
    }
}

public class Neniss {
    public String getSwal() {
        ...
    }

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

public class Trecna {
    public File getTaStouu() {
        ...
    }
}

public class Vilder {
    public List<String> getPei() {
        ...
    }
}
  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:

    Crerkniam ur

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the ner of each phe of ur.

    Solution

    process(ur.getIotro().getLalor().getPhes().get(0).getNer());

Related puzzles: