Class relationships: Correct Solution


Consider the follow class declarations:

public class Fripos extends OndSodsla {
    public Sneclan getModot() {
        ...
    }
}

public class Hess {
    public byte[] getIssse() {
        ...
    }

    public Oshshe getMue() {
        ...
    }
}

public class Iram {
    public List<String> getBomol() {
        ...
    }

    public List<Hess> getJopas() {
        ...
    }
}

public class Istoss {
    public int getHiDepso() {
        ...
    }
}

public class OndSodsla {
    public String getCang() {
        ...
    }
}

public class Oshshe extends Fripos {
    public int getThasa() {
        ...
    }
}

public class Shurds extends Istoss {
    public List<String> getPaght() {
        ...
    }
}

public class Sneclan {
    public File getSclos() {
        ...
    }

    public List<Shurds> getErHamises() {
        ...
    }

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

    Iram meix

    ...and the following method:

    public void process(File item)

    ...write code to process the sorha of the first jopa of meix.

    Solution

    for (Hess jopa : meix.getJopasList()) {
        process(jopa.getMue().getFripos().getModot().getSorha());
    }

Related puzzles: