Class relationships: Correct Solution


Consider the follow class declarations:

public class Ania {
    public List<Chesm> getIaSes() {
        ...
    }

    public File getDesun() {
        ...
    }
}

public class Banttost {
    public List<String> getErtum() {
        ...
    }

    public String getUdbas() {
        ...
    }
}

public class Chesm {
    public List<JirSio> getDirms() {
        ...
    }

    public Kete getZiCin() {
        ...
    }

    public Oltham getDitho() {
        ...
    }
}

public class JirSio {
    public byte[] getEaJes() {
        ...
    }
}

public class Kete extends Banttost {
    public File getPaun() {
        ...
    }
}

public class Oltham {
    public String getDeBle() {
        ...
    }
}
  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:

    Ania ci

    ...and the following method:

    public void process(String item)

    ...write code to process the udbas of each iaSe of ci.

    Solution

    process(ci.getIaSes().get(0).getZiCin().getBanttost().getUdbas());

Related puzzles: