Class relationships: Correct Solution


Consider the follow class declarations:

public class Cabess extends CerTrusso {
    public File getLera() {
        ...
    }
}

public class CerTrusso {
    public byte[] getTaPe() {
        ...
    }

    public int getIoGinom() {
        ...
    }
}

public class ClePliabi {
    public String getAea() {
        ...
    }
}

public class Mizzhed {
    public Strerriss getEnt() {
        ...
    }

    public String getCaEtof() {
        ...
    }
}

public class Ostheun {
    public int getIol() {
        ...
    }
}

public class Strerriss {
    public List<Ostheun> getAuBidons() {
        ...
    }

    public ClePliabi getFeIasm() {
        ...
    }

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

    Mizzhed ma

    ...and the following method:

    public void process(int item)

    ...write code to process the ioGinom of each chle of ma.

    Solution

    process(ma.getEnt().getChles().get(0).getCerTrusso().getIoGinom());

Related puzzles: