Class relationships: Correct Solution


Consider the follow class declarations:

public class Camu {
    public List<PleClepoa> getCles() {
        ...
    }

    public byte[] getChed() {
        ...
    }
}

public class Cassni {
    public List<String> getPeKes() {
        ...
    }

    public CesNeosplem getRoRa() {
        ...
    }
}

public class CesNeosplem extends Camu {
    public byte[] getSosoe() {
        ...
    }
}

public class Gulner {
    public List<String> getEdVo() {
        ...
    }

    public byte[] getChrec() {
        ...
    }
}

public class Hacpo {
    public File getHess() {
        ...
    }
}

public class Irels extends Gulner {
    public byte[] getSaAn() {
        ...
    }
}

public class Mipul {
    public String getIrAng() {
        ...
    }
}

public class Monhi {
    public List<Hacpo> getPocnis() {
        ...
    }

    public List<Cassni> getClamas() {
        ...
    }

    public List<Totio> getIoinds() {
        ...
    }
}

public class Onpli {
    public File getPiAs() {
        ...
    }
}

public class PleClepoa extends Mipul {
    public Irels getViit() {
        ...
    }

    public Onpli getMaXas() {
        ...
    }
}

public class Totio {
    public int getIam() {
        ...
    }

    public Ucbae getNic() {
        ...
    }
}

public class Ucbae {
    public byte[] getCoTiock() {
        ...
    }
}
  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:

    Monhi uco

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the chrec of the first cle of each clama of uco.

    Solution

    for (PleClepoa cle : uco.getClamas().get(0).getRoRa().getCamu().getClesList()) {
        process(cle.getViit().getGulner().getChrec());
    }

Related puzzles: