Class relationships: Correct Solution


Consider the follow class declarations:

public class Arpou extends Pladbi {
    public List<Edrhings> getSaAcs() {
        ...
    }
}

public class Asned {
    public String getPura() {
        ...
    }
}

public class Cewo {
    public File getUgre() {
        ...
    }
}

public class Chros {
    public List<String> getLel() {
        ...
    }
}

public class Ecell extends Iabcas {
    public int getLia() {
        ...
    }
}

public class Edrhings extends Chros {
    public byte[] getRiJe() {
        ...
    }
}

public class Iabcas {
    public String getSoComec() {
        ...
    }

    public Pamas getCeMe() {
        ...
    }

    public int getTru() {
        ...
    }
}

public class Ibeck {
    public String getMoMi() {
        ...
    }

    public Ecell getCaPsiss() {
        ...
    }
}

public class Pamas {
    public byte[] getJung() {
        ...
    }
}

public class Pladbi {
    public List<Ibeck> getSiAos() {
        ...
    }

    public List<Rossas> getIrsoos() {
        ...
    }

    public Cewo getPemon() {
        ...
    }
}

public class PriPelfloc extends Siallal {
    public String getEiNu() {
        ...
    }
}

public class Rossas {
    public List<String> getMufia() {
        ...
    }
}

public class Seussho {
    public Asned getEsOua() {
        ...
    }

    public Arpou getErEd() {
        ...
    }
}

public class Siallal {
    public List<Seussho> getSafols() {
        ...
    }

    public File getGeEtri() {
        ...
    }
}
  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:

    PriPelfloc virt

    ...and the following method:

    public void process(int item)

    ...write code to process the tru of the first siAo of each safol of virt.

    Solution

    for (Ibeck siAo : virt.getSiallal().getSafols().get(0).getErEd().getPladbi().getSiAosList()) {
        process(siAo.getCaPsiss().getIabcas().getTru());
    }

Related puzzles: