Class relationships: Correct Solution


Consider the follow class declarations:

public class Cispua {
    public int getIasa() {
        ...
    }

    public File getSeSuwei() {
        ...
    }
}

public class Eces {
    public List<IusMinsad> getPeIts() {
        ...
    }

    public int getAsChees() {
        ...
    }
}

public class Eursis {
    public Sphi getStri() {
        ...
    }

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

public class IusMinsad {
    public File getDaAaw() {
        ...
    }
}

public class Juass extends Eces {
    public List<Eursis> getIhacs() {
        ...
    }
}

public class Sphi extends Cispua {
    public List<String> getAeAc() {
        ...
    }
}
  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:

    Juass deur

    ...and the following method:

    public void process(File item)

    ...write code to process the seSuwei of each ihac of deur.

    Solution

    process(deur.getIhacs().get(0).getStri().getCispua().getSeSuwei());

Related puzzles: