Class relationships: Correct Solution


Consider the follow class declarations:

public class Cecphin {
    public Sangbe getOnec() {
        ...
    }

    public List<Liumun> getRePopts() {
        ...
    }
}

public class Cerplail {
    public byte[] getPeProir() {
        ...
    }

    public int getOsm() {
        ...
    }
}

public class EucOul {
    public Cecphin getPreus() {
        ...
    }

    public int getActer() {
        ...
    }
}

public class Fibiss {
    public List<String> getMuah() {
        ...
    }

    public List<Plonma> getBinus() {
        ...
    }
}

public class Liumun {
    public String getAiss() {
        ...
    }
}

public class Nemen {
    public String getEcpro() {
        ...
    }
}

public class Plonma extends EucOul {
    public List<String> getRulph() {
        ...
    }
}

public class Sangbe extends Cerplail {
    public Shess getRanan() {
        ...
    }

    public List<Strourchus> getEsBas() {
        ...
    }
}

public class Shess {
    public byte[] getDiarm() {
        ...
    }
}

public class Strourchus {
    public Nemen getPlen() {
        ...
    }

    public int getCeed() {
        ...
    }
}
  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:

    Fibiss nesm

    ...and the following method:

    public void process(int item)

    ...write code to process the osm of the first binu of nesm.

    Solution

    for (Plonma binu : nesm.getBinusList()) {
        process(binu.getEucOul().getPreus().getOnec().getCerplail().getOsm());
    }

Related puzzles: