Class relationships: Correct Solution


Consider the follow class declarations:

public class Gaop {
    public int getPiar() {
        ...
    }
}

public class IasPlesec extends Sphict {
    public File getGimur() {
        ...
    }
}

public class Ikna {
    public List<Gaop> getCisses() {
        ...
    }

    public List<Jellar> getHaEas() {
        ...
    }
}

public class Jellar {
    public PeiValma getPhiip() {
        ...
    }

    public String getBil() {
        ...
    }
}

public class PeiValma {
    public byte[] getIme() {
        ...
    }

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

public class PlaPhe {
    public int getNaLouc() {
        ...
    }
}

public class Sphict extends Traltand {
    public PlaPhe getOdrur() {
        ...
    }

    public Ikna getRuod() {
        ...
    }
}

public class Traltand {
    public List<String> getHinin() {
        ...
    }
}
  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:

    IasPlesec shei

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the edBopa of each haEa of shei.

    Solution

    process(shei.getSphict().getRuod().getHaEas().get(0).getPhiip().getEdBopa());

Related puzzles: