Class relationships: Correct Solution


Consider the follow class declarations:

public class Accho {
    public Ertzec getOeo() {
        ...
    }

    public List<Sengshi> getRiPras() {
        ...
    }
}

public class Bestaic extends Celfesh {
    public List<String> getAnia() {
        ...
    }
}

public class Blioc {
    public String getOwusm() {
        ...
    }
}

public class Celfesh {
    public Mengoust getIpVauck() {
        ...
    }

    public List<Accho> getSeCics() {
        ...
    }
}

public class Cigash {
    public List<Moria> getSlegos() {
        ...
    }

    public int getHaIsria() {
        ...
    }
}

public class Dass extends Miphbi {
    public Blioc getOtIari() {
        ...
    }
}

public class Donno {
    public Bestaic getRawio() {
        ...
    }

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

public class Ertzec {
    public List<String> getFik() {
        ...
    }

    public List<IolPussfis> getFeoms() {
        ...
    }
}

public class IolPussfis extends Dass {
    public String getCucle() {
        ...
    }
}

public class Jermlod {
    public byte[] getUss() {
        ...
    }
}

public class Mengoust {
    public String getFiol() {
        ...
    }
}

public class Miphbi {
    public List<Jermlod> getKears() {
        ...
    }

    public Cigash getHiNas() {
        ...
    }

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

public class Moria {
    public byte[] getSca() {
        ...
    }
}

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

    Donno psa

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the idCes of each feom of each seCic of psa.

    Solution

    process(psa.getRawio().getCelfesh().getSeCics().get(0).getOeo().getFeoms().get(0).getDass().getMiphbi().getIdCes());

Related puzzles: