Class relationships: Correct Solution


Consider the follow class declarations:

public class Cied {
    public File getWael() {
        ...
    }
}

public class Engknu {
    public String getQinir() {
        ...
    }
}

public class Ferpe extends Snacass {
    public List<Proshpoar> getUasses() {
        ...
    }
}

public class Jian {
    public byte[] getPlid() {
        ...
    }

    public Kesmstri getSaCel() {
        ...
    }
}

public class Kesmstri extends Spust {
    public List<String> getJiaga() {
        ...
    }
}

public class Molgeem {
    public String getVeon() {
        ...
    }

    public List<Podces> getElKuflis() {
        ...
    }

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

public class NacAssptar {
    public List<Molgeem> getBrecs() {
        ...
    }

    public Engknu getPuCa() {
        ...
    }

    public Cied getTroi() {
        ...
    }
}

public class OoeOon {
    public String getHeIss() {
        ...
    }
}

public class Podces extends OoeOon {
    public List<String> getDaka() {
        ...
    }
}

public class Proshpoar {
    public byte[] getHiqir() {
        ...
    }
}

public class Snacass {
    public List<String> getWesm() {
        ...
    }

    public NacAssptar getIaje() {
        ...
    }
}

public class Spust {
    public File getPruco() {
        ...
    }

    public List<Ferpe> getUfics() {
        ...
    }
}
  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:

    Jian es

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the geho of the first brec of each ufic of es.

    Solution

    for (Molgeem brec : es.getSaCel().getSpust().getUfics().get(0).getSnacass().getIaje().getBrecsList()) {
        process(brec.getGeho());
    }

Related puzzles: