Class relationships: Correct Solution


Consider the follow class declarations:

public class Bacgre extends Eriph {
    public byte[] getOeBeima() {
        ...
    }
}

public class Diwn extends Ulpiat {
    public List<String> getNoAm() {
        ...
    }
}

public class Eriph {
    public Gouke getFli() {
        ...
    }

    public int getLesco() {
        ...
    }
}

public class EsoPrudshac {
    public String getWeAd() {
        ...
    }

    public List<Irtse> getGipis() {
        ...
    }
}

public class Gouke {
    public int getMaAs() {
        ...
    }

    public List<Scia> getDoracs() {
        ...
    }

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

public class Icrias {
    public File getIcid() {
        ...
    }
}

public class Irtse {
    public int getEuErdpa() {
        ...
    }
}

public class Pethe extends Phusmphil {
    public Icrias getBiDu() {
        ...
    }

    public List<Diwn> getCehos() {
        ...
    }
}

public class Phusmphil {
    public File getVung() {
        ...
    }

    public EsoPrudshac getRiris() {
        ...
    }
}

public class Scia {
    public String getChoc() {
        ...
    }
}

public class Skasse {
    public Pethe getHeTa() {
        ...
    }

    public File getPlong() {
        ...
    }
}

public class Ulpiat {
    public File getExTaap() {
        ...
    }

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

    Skasse ce

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the nem of each onEs of the first ceho of ce.

    Solution

    for (Diwn ceho : ce.getHeTa().getCehosList()) {
        process(ceho.getUlpiat().getOnEses().get(0).getEriph().getFli().getNem());
    }

Related puzzles: