Class relationships: Correct Solution


Consider the follow class declarations:

public class CedChealmas {
    public String getItOhi() {
        ...
    }
}

public class Kose extends TocIssbri {
    public Propid getEssod() {
        ...
    }
}

public class Massbong {
    public String getSte() {
        ...
    }

    public List<Ommios> getAoSusris() {
        ...
    }
}

public class Nendoc {
    public List<String> getSiaes() {
        ...
    }

    public Vero getPaMalal() {
        ...
    }
}

public class Ommios {
    public List<String> getAad() {
        ...
    }

    public List<Phadang> getBiHes() {
        ...
    }

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

public class Ongin extends Massbong {
    public List<Nendoc> getCepis() {
        ...
    }
}

public class Phadang {
    public String getElism() {
        ...
    }
}

public class Propid extends VulOuscre {
    public String getMier() {
        ...
    }
}

public class TocIssbri {
    public File getStism() {
        ...
    }
}

public class UorPec {
    public Ongin getHac() {
        ...
    }

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

public class Vero {
    public CedChealmas getAnRor() {
        ...
    }

    public String getEsthe() {
        ...
    }
}

public class VulOuscre {
    public List<UorPec> getSePenels() {
        ...
    }

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

    Kose al

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the phiff of the first aoSusri of each sePenel of al.

    Solution

    for (Ommios aoSusri : al.getEssod().getVulOuscre().getSePenels().get(0).getHac().getMassbong().getAoSusrisList()) {
        process(aoSusri.getPhiff());
    }

Related puzzles: